Bug 126460 - Wrong rendering with Greyscale TIF with no / transparent background
Summary: Wrong rendering with Greyscale TIF with no / transparent background
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.4.0 target:6.3.1 target:7.2.0
Keywords:
Depends on:
Blocks: Images-TIFF
  Show dependency treegraph
 
Reported: 2019-07-18 09:20 UTC by joachim_liedtke
Modified: 2020-12-18 11:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Greyscale TIF with transparent background (8.84 KB, image/tiff)
2019-07-18 09:22 UTC, joachim_liedtke
Details
printscreen from LO 6.4 and LO 4.1 (19.08 KB, application/vnd.oasis.opendocument.text)
2019-07-21 19:01 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description joachim_liedtke 2019-07-18 09:20:55 UTC
Description:
When you insert a Greyscale TIF with no background resp. transparent background in LibreOffice Writer the image will displayed wrong. The results vary from complete black image to inverted image.

Steps to Reproduce:
1. Create a Greyscale TIF with no background
2. Save it with no compression or LZW compression. ZIP compression is not supported in LibreOffice
3. Insert the image in LibreOffice Writer

Actual Results:
Image in Writer is black or inverted

Expected Results:
To display the image correctly.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.2.3.2
Build-ID: aecc05fe267cc68dde00352a451aa867b3b546ac
CPU-Threads: 6; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 1 joachim_liedtke 2019-07-18 09:22:00 UTC
Created attachment 152854 [details]
Greyscale TIF with transparent background
Comment 2 raal 2019-07-21 19:00:49 UTC
Confirm with Version: 6.4.0.0.alpha0+
Build ID: 47a774fbef8c224e4853de3fdd0230b9442bb716
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Comment 3 raal 2019-07-21 19:01:56 UTC
Created attachment 152895 [details]
printscreen from LO 6.4 and LO 4.1

compare LO 4.1 and LO 6.4 - it's wrong in both versions, but worse in 6.4
Comment 4 raal 2019-07-21 19:24:34 UTC
(In reply to raal from comment #3)
> Created attachment 152895 [details]
> printscreen from LO 6.4 and LO 4.1
> 
> compare LO 4.1 and LO 6.4 - it's wrong in both versions, but worse in 6.4

Bisected to 75b3cd34182fc8057d3c402a7c4435b2e61e60a0 is the first bad commit
commit 75b3cd34182fc8057d3c402a7c4435b2e61e60a0
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Sep 5 20:35:12 2015 +0800

    source-hash-98a61a2ae109f3d72940274ceafcf3e84d79aa0b
    
    commit 98a61a2ae109f3d72940274ceafcf3e84d79aa0b
    Author:     Caolán McNamara <caolanm@redhat.com>
    AuthorDate: Thu Aug 22 15:06:10 2013 +0100
    Commit:     Caolán McNamara <caolanm@redhat.com>
    CommitDate: Thu Aug 22 15:08:05 2013 +0100
    
        Resolves: fdo#68275 Grayscale TIFF is imported as white
    
        this reverts 6c719c1585eb1a2dbab86cc73ff871da41765981 "n#615223 local nbyte1
        should have been class-level nByte1" which was to fix the use seen
        in valgrind og the uninitialized nByte1
    
        So additionally remove the use of the uninit nByte1 entirely


Adding Cc: to Caolán McNamara
Comment 5 Caolán McNamara 2019-07-22 13:34:33 UTC
bisect just points to location where wrongness changed, there doesn't appear to be a known working state
Comment 6 Caolán McNamara 2019-07-22 14:41:05 UTC
This two byte format seems to be greyscale byte followed by alpha byte, or at least that's what imagemagick seems to do
Comment 7 Commit Notification 2019-07-23 09:07:24 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/09ad0e78129d4f85fd1b847b35409fd5440ed23c%5E%21

Resolves: tdf#126460 implement reading grayscale+alpha tiff format

It will be available in 6.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.
Comment 8 Commit Notification 2019-07-23 11:18:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/fda86dd781a80703f06ae1b6056439bafed190a8%5E%21

Resolves: tdf#126460 implement reading grayscale+alpha tiff format

It will be available in 6.3.1.

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.
Comment 9 Commit Notification 2020-12-18 11:30:12 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8cfad2357f309c8f8aaf11c89722307b5bd704c7

tdf#126460: libtest_filter_tiff: Add unittest

It will be available in 7.2.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.