Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.1, 5.6.0
-
X11 Windows
Description
As title says the documentation says that LZW compression will be used if 1 (one) is provided as argument to the setCompression method of the QImageWriter, however git blame and source code are saying that not every format of the png will use LZW. This one for instance:
f68a3dc4 (Kent Hansen 2012-01-31 07:01:22 +0100 527) || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_CCITTRLE)
Documentation does not says explicitly which image formats can use LZW conversion that assumes each and every png image can be compressed with LZW compression method.
As practice shows the fix should be pretty easy in this case and I see two of them:
1. Fix documentation, specify all formats that can use LZW compression
2. Replace this COMPRESSION_CCITTRLE with this COMPRESSION_LZW
Which one you choose is up to you. If you prefer the first one, please assign this report to the documentation team.
However, as practice shows replacing the old compression will work on both Linux (checked by me) and Windows (checked by support_silver).
What here is expected:
the implementation is synchronized with documentation and each and every png can be converted to the tiff using LZW compression.
What actually happens:
only some png image can be converted to the tiff using LZW compression
Steps to reproduce:
1. Download demo attached.
2. Use youtube.png attached. Everything works tiff was created with LZW compression. Can be checked with tiffinfo tool
3. Use Sample1.png. LZW is not used.