Browse Source

LibGfx/TIFF: Accept the PixarDeflate compression tag

I would have liked to avoid adding a deprecated tag but this is the one
currently in use in Krita.
Lucas CHOLLET 1 year ago
parent
commit
284e785053

+ 2 - 1
Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp

@@ -354,7 +354,8 @@ private:
             TRY(loop_over_pixels(move(decode_lzw_strip)));
             break;
         }
-        case Compression::AdobeDeflate: {
+        case Compression::AdobeDeflate:
+        case Compression::PixarDeflate: {
             // This is an extension from the Technical Notes from 2002:
             // https://web.archive.org/web/20160305055905/http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf
             ByteBuffer decoded_bytes {};

+ 1 - 0
Userland/Libraries/LibGfx/TIFFGenerator.py

@@ -58,6 +58,7 @@ class Compression(EnumWithExportName):
     JPEG = 6
     AdobeDeflate = 8
     PackBits = 32773
+    PixarDeflate = 32946  # This is the old (and deprecated) code for AdobeDeflate
 
 
 class PhotometricInterpretation(EnumWithExportName):