|
|
|
@ -13,7 +13,6 @@ using SixLabors.ImageSharp.IO; |
|
|
|
using SixLabors.ImageSharp.Memory; |
|
|
|
using SixLabors.ImageSharp.Metadata; |
|
|
|
using SixLabors.ImageSharp.Metadata.Profiles.Exif; |
|
|
|
using SixLabors.ImageSharp.Metadata.Profiles.Xmp; |
|
|
|
using SixLabors.ImageSharp.PixelFormats; |
|
|
|
|
|
|
|
namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
@ -33,6 +32,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
/// </summary>
|
|
|
|
private readonly bool ignoreMetadata; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the decoding mode for multi-frame images
|
|
|
|
/// </summary>
|
|
|
|
private FrameDecodingMode decodingMode; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The stream to decode from.
|
|
|
|
/// </summary>
|
|
|
|
@ -59,6 +63,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
|
|
|
|
this.Configuration = configuration ?? Configuration.Default; |
|
|
|
this.ignoreMetadata = options.IgnoreMetadata; |
|
|
|
this.decodingMode = options.DecodingMode; |
|
|
|
this.memoryAllocator = this.Configuration.MemoryAllocator; |
|
|
|
} |
|
|
|
|
|
|
|
@ -160,11 +165,16 @@ namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
cancellationToken.ThrowIfCancellationRequested(); |
|
|
|
ImageFrame<TPixel> frame = this.DecodeFrame<TPixel>(ifd, cancellationToken); |
|
|
|
frames.Add(frame); |
|
|
|
|
|
|
|
if (this.decodingMode is FrameDecodingMode.First) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ImageMetadata metadata = TiffDecoderMetadataCreator.Create(frames, this.ignoreMetadata, reader.ByteOrder, reader.IsBigTiff); |
|
|
|
|
|
|
|
// TODO: Tiff frames can have different sizes
|
|
|
|
// TODO: Tiff frames can have different sizes.
|
|
|
|
ImageFrame<TPixel> root = frames[0]; |
|
|
|
this.Dimensions = root.Size(); |
|
|
|
foreach (ImageFrame<TPixel> frame in frames) |
|
|
|
|