// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
//
//
// Provides the necessary information to support tiff images.
//
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Imaging.Formats
{
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
///
/// Provides the necessary information to support tiff images.
///
public class TiffFormat : FormatBase
{
///
/// Gets the file headers.
///
public override byte[][] FileHeaders
{
get
{
return new[]
{
new byte[] { 73, 73, 42, 0 },
new byte[] { 77, 77, 0, 42 }
};
}
}
///
/// Gets the list of file extensions.
///
public override string[] FileExtensions
{
get
{
return new[] { "tiff", "tif" };
}
}
///
/// Gets the standard identifier used on the Internet to indicate the type of data that a file contains.
///
public override string MimeType
{
get
{
return "image/tiff";
}
}
///
/// Gets the .
///
public override ImageFormat ImageFormat
{
get
{
return ImageFormat.Tiff;
}
}
///
/// Applies the given processor the current image.
///
/// The processor delegate.
/// The .
public override void ApplyProcessor(Func processor, ImageFactory factory)
{
base.ApplyProcessor(processor, factory);
// Set the property item information from any Exif metadata.
// We do this here so that they can be changed between processor methods.
if (factory.PreserveExifData)
{
foreach (KeyValuePair propertItem in factory.ExifPropertyItems)
{
factory.Image.SetPropertyItem(propertItem.Value);
}
}
}
}
}