Description: When importing TIFF format image with indexed colors, up to 5 pixels at right edge are dropped and the previous pixel column is repeated instead. Steps to Reproduce: 1. Download attached image 1px border.tif or complex.tif 2. Drag them to Draw, Writer or Impress. Actual Results: Mungled up right side of images. See attached screenshots. Expected Results: Pixel perfect image. Reproducible: Always User Profile Reset: No Additional Info: This bug is pretty old, at least from version 3.5, just got fed up enough today to report it.
Created attachment 144656 [details] 0px border.tif Example TIF file, shows bug.
Created attachment 144657 [details] Example document in Draw
Created attachment 144658 [details] Screenshot of example document
Created attachment 144659 [details] complex.tif More complex example file.
Created attachment 144660 [details] Screenshot of more complex example.
The artefacts look like bug 56178, do you think it is the same underlying issue?
Thanks for your reply. I don't think these bugs are much related. That one is about slightly less common compression format in TIFF being incorrectly decompressed (or initially just crashing). This one is most likely something much simpler, such as simply counting rows and columns incorrectly when decompressing the image.
Ok, I confirmed it in 3.3.0.
Dear mahfiaz, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
On pc Debian x86-64 with master sources updated today, I could reproduce this. Here's tiffinfo result on the file: TIFF Directory at offset 0x8 (8) Subfile Type: (0 = 0x0) Image Width: 30 Image Length: 165 Resolution: 600, 600 pixels/inch Bits/Sample: 1 Sample Format: unsigned integer Compression Scheme: LZW Photometric Interpretation: min-is-white Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 128 Planar Configuration: single image plane SubIFD Offsets: 354 DocumentName: H:\Desktop\LibO bug\0px border.tif Software: GIMP 2.10.6 DateTime: 2018:09:04 11:06:43
Code pointer: https://opengrok.libreoffice.org/xref/core/vcl/source/filter/itiff/itiff.cxx?r=520d8c9e#679 (nCompression = 5 corresponds to LZW, the case here). + files vcl/source/filter/itiff/lzwdecom.hxx/cxx When looking at initial doc then complex doc, it seems that for about the first bit of last byte, if this one is white, the rest of the line is white, if it's black, the rest is black. Now, I spent several hours on these files and don't know where is the bug. Also, I find LZW not simple + you must consider tiff use with CLEAR code (256) and EOI code (257). I wish I had a far better brain...
Patch waiting for review here: https://gerrit.libreoffice.org/c/core/+/134235 I was so convinced it was due to lzw decoding but in fact, the pb was more general and present in ConvertScanline. Image width is 30 pixels, since the parameter of the file was 1bit per pixels, it needs 4 bytes per row (the last 2 bits of byte 4 is unused). The mechanism to read a full byte was ok, the pb was when reading an incomplete byte (so the fourth one in our case). Indeed, it's using shifting operation to read each bit of the last byte but the shifting value was the same at each loop. It explains the previous comment, LO was fetching the same bit for all the remaining bits to read in the fourth byte. With the patch the initial example and the more complex one works. Also, it may help for tiff files using 1 bit per pixel with no byte swap/fillorder (I think the most general case), not only those using LZW compression.
Hey, this is some detective level work. Thanks for fixing this!
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/891ff1334eb4288668ebf70636d7972af691fa88 tdf#119686: fix tiff with 1 bit per pixel It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Patch waiting for review for 7.3 branch. https://gerrit.libreoffice.org/c/core/+/134248 (hope someone will review it, if not, it'll be fixed only from future 7.4.0)
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/cc6e2d409328f8e4d06305dde47cdc794945b4d8 tdf#119686: fix tiff with 1 bit per pixel It will be available in 7.3.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
This works like a charm in the daily build. Well done!
Thank you! Let's put this one to VERIFIED then.