Support multi-sized (e.g. pyramid) TIFFs #1982
Replies: 2 comments 19 replies
-
ImageSharp has a core architectural assumption that an image has a single size (even when it consists of multiple frames), so this won't be easy to achieve. We can pick the biggest frame, and extend the rest, but I think this is not what users want, since it would loose information. The only solution I can think of is a custom, TIFF-specific API, that would return an |
Beta Was this translation helpful? Give feedback.
-
According to the following information Tiff supports X/Y position tags for the image.
According to the TIFF 6 spec, they are in resolution units. so to work out the pixel position they would be multiplied by X/YResolution and rounded to the nearest int. I have found nothing to confirm this but I don't think any frames that follow the first frame can be larger than the first frame so we can always take that frame as the image size. We can check X/Y Position for subsequent frames that are smaller and offset them in the buffer like we do during Gif decode. When encoding we can either allow setting a background color and trimming that or simply trim transparent like I do with Gif in #2455 and set those tags appropriately. |
Beta Was this translation helpful? Give feedback.
-
Currently, TIFFs with multiple frame sizes are not supported:
There is a TODO comment:
// TODO: Tiff frames can have different sizes
but @JimBobSquarePants asked me to create a feature request as reminder ;)Beta Was this translation helpful? Give feedback.
All reactions