1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:37:35 +00:00

LibGfx/TIFF: Accept images with a single strip and no RowsPerStrip tag

This tag is required by the specification, but some encoders (at least
Krita) don't write it for images with a single strip.

The test file was generated by opening deflate.tiff in Krita and saving
it with the DEFLATE compression.
This commit is contained in:
Lucas CHOLLET 2024-01-16 00:27:52 -05:00 committed by Andreas Kling
parent 284e785053
commit c2c7365494
4 changed files with 20 additions and 4 deletions

View file

@ -128,7 +128,7 @@ known_tags: List[Tag] = [
Tag('273', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [], None, "StripOffsets", is_required=True),
Tag('274', [TIFFType.UnsignedShort], [1], Orientation.Default, "Orientation", Orientation),
Tag('277', [TIFFType.UnsignedShort], [1], None, "SamplesPerPixel", is_required=True),
Tag('278', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [1], None, "RowsPerStrip", is_required=True),
Tag('278', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [1], None, "RowsPerStrip", is_required=False),
Tag('279', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [], None, "StripByteCounts", is_required=True),
Tag('282', [TIFFType.UnsignedRational], [1], None, "XResolution"),
Tag('283', [TIFFType.UnsignedRational], [1], None, "YResolution"),