Bug 398548 - Saving a TIFF image with RLE compression causes unreadable images
Summary: Saving a TIFF image with RLE compression causes unreadable images
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.1.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-09-12 16:39 UTC by Antti Savolainen
Modified: 2021-07-19 05:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Garbled image (940.53 KB, image/tiff)
2018-09-12 16:39 UTC, Antti Savolainen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Savolainen 2018-09-12 16:39:28 UTC
Created attachment 114917 [details]
Garbled image

When saving a TIFF image 'CCITT Modified Huffman RLE' causes the image to become garbled.
I've attached a pure white image saved in this method.
Comment 1 Halla Rempt 2018-09-13 12:52:22 UTC
This looks like a regression: it works with krita 3.3.3.
Comment 2 Dmitry Kazakov 2018-09-13 14:52:47 UTC
According to the TIFF standard, this compression mode is defined for 1 bit-per-pixel images only. So I think we should just remove this option (alongside other two "fax" options).


=== Snip from the standard ===

2 =  CCITT Group  3 1-Dimensional  Modified  Huffman  run  length
encoding.   See Appendix  B:   "Data Compression  --  Scheme  2."
BitsPerSample must  be 1,  since  this  type  of  compression  is
defined only for bilevel images.

     When  you  decompress  data  that  has  been  compressed  by
Compression=2, you  must translate  white runs into 0's and black
runs into  1's.   Therefore, the normal PhotometricInterpretation
for those  compression types  is 0  (WhiteIsZero).   If a  reader
encounters a  PhotometricInterpretation of  1  (BlackIsZero)  for
such an  image, the  image should  be displayed  and printed with
black and white reversed.
Comment 3 Dmitry Kazakov 2018-09-13 15:26:56 UTC
Git commit 5db89dc523fb35e17fd00a2ec204a28405c7ce06 by Dmitry Kazakov.
Committed on 13/09/2018 at 15:20.
Pushed by dkazakov into branch 'master'.

Remove fax-related tiff options

In fax mode tiff can store only 1 bit per channel images,
which Krita doesn't support. So just remove these options
from the GUI

M  +1    -6    plugins/impex/tiff/kis_dlg_options_tiff.cpp
M  +4    -10   plugins/impex/tiff/kis_tiff_converter.cc
M  +0    -1    plugins/impex/tiff/kis_tiff_converter.h
M  +0    -1    plugins/impex/tiff/kis_tiff_writer_visitor.cpp
M  +51   -78   plugins/impex/tiff/kis_wdg_options_tiff.ui

https://commits.kde.org/krita/5db89dc523fb35e17fd00a2ec204a28405c7ce06
Comment 4 Halla Rempt 2018-09-15 09:11:10 UTC
Git commit ebc0b62c3cb0531094a022fa637753ad29315eff by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 15/09/2018 at 09:08.
Pushed by rempt into branch 'krita/4.1'.

Remove fax-related tiff options

In fax mode tiff can store only 1 bit per channel images,
which Krita doesn't support. So just remove these options
from the GUI

M  +1    -6    plugins/impex/tiff/kis_dlg_options_tiff.cpp
M  +4    -10   plugins/impex/tiff/kis_tiff_converter.cc
M  +0    -1    plugins/impex/tiff/kis_tiff_converter.h
M  +0    -1    plugins/impex/tiff/kis_tiff_writer_visitor.cpp
M  +51   -78   plugins/impex/tiff/kis_wdg_options_tiff.ui

https://commits.kde.org/krita/ebc0b62c3cb0531094a022fa637753ad29315eff
Comment 5 Dmitry Kazakov 2021-07-19 05:44:55 UTC
Git commit 49788da184fe01c571780e792498f032700bd629 by Dmitry Kazakov, on behalf of L. E. Segovia.
Committed on 19/07/2021 at 05:44.
Pushed by dkazakov into branch 'master'.

TIFF: fix display of options for Pixar log compression

The index for the codecsOptionsStack wasn't updated to account for the
removal of the fax options in 5db89dc523fb35e17fd00a2ec204a28405c7ce06.

M  +1    -1    plugins/impex/tiff/kis_dlg_options_tiff.cpp

https://invent.kde.org/graphics/krita/commit/49788da184fe01c571780e792498f032700bd629