Bug 142151 - Red cast rendered in 16 bit TIFF image
Summary: Red cast rendered in 16 bit TIFF image
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.4.0 target:7.3.3 target:7.2....
Keywords:
: 36300 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-07 11:10 UTC by Alistair Saywell
Modified: 2022-04-28 19:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
16 bit Tiff image of a watch, low resolution as example. (358.30 KB, image/tiff)
2021-05-07 11:10 UTC, Alistair Saywell
Details
RGB 8 bits (977 bytes, application/zip)
2022-04-17 18:00 UTC, Julien Nabet
Details
RGB 16 bits (1010 bytes, application/zip)
2022-04-17 18:02 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alistair Saywell 2021-05-07 11:10:22 UTC
Created attachment 171740 [details]
16 bit Tiff image of a watch, low resolution as example.

16 bit TIFF image is imported into Writer document but is rendered with a strong red cast. Question raised on https://ask.libreoffice.org/en/question/307974/writer-insert-image-comes-out-red/
Expected case: It is imported and rendered as it would appear normally in a graphics viewer.
Compare Word 2010 which renders it normally. Not a common issue as 16 bit is not normally used in general work.
Sample image attached that will render with a red cast

Version: 7.0.5.2 (x64)
Build ID: 64390860c6cd0aca4beafafcfd84613dd9dfb63a
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-NZ (en_NZ); UI: en-GB
Calc: CL
Comment 1 Alistair Saywell 2021-05-10 05:29:20 UTC
The mishandling seems to happen in the TIFF filter as the same image saved as 16 bit PNG displays normally, without any red cast.
Comment 2 Mike Kaganski 2021-05-10 08:21:19 UTC
Repro with:

Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

as well as with current master, and also with OOo 3.2.0.
Comment 3 Julien Nabet 2022-04-17 18:00:44 UTC
Created attachment 179627 [details]
RGB 8 bits

I attached a zip containing 3 files with RGB 8 bits without compression (1 red, 1 green, 1 blue) => it's ok
Comment 4 Julien Nabet 2022-04-17 18:02:21 UTC
Created attachment 179628 [details]
RGB 16 bits

first 10 lines returned by tiffinfo 16bitImage100dpi.tif gives:
TIFF Directory at offset 0x8 (8)
  Image Width: 138 Image Length: 338
  Resolution: 100, 100 pixels/inch
  Bits/Sample: 16
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 128

So I attached a zip containing 3 files with RGB 16 bits without compression (1 red, 1 green, 1 blue) => red one is ok, the 2 others are black.

The pb seems the 16 bits color case.
Comment 5 Julien Nabet 2022-04-17 18:05:51 UTC
I gave a try with https://gerrit.libreoffice.org/c/core/+/133108
Comment 6 Commit Notification 2022-04-18 09:59:08 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/49ee1c889665c3539fa9a1c99a865a42fc08ee97

tdf#142151: Red cast rendered in 16 bit TIFF image

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.
Comment 7 Xisco Faulí 2022-04-18 10:21:42 UTC
*** Bug 36300 has been marked as a duplicate of this bug. ***
Comment 8 Commit Notification 2022-04-18 11:04:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/1af0bf010b839b7b34e856dfc5a7385db45c9aa7

tdf#142151: Red cast rendered in 16 bit TIFF image

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.
Comment 9 Commit Notification 2022-04-18 13:05:17 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/e8f7138292b1e5eabac7969e8d6fe64d3dda3e51

tdf#142151: Red cast rendered in 16 bit TIFF image

It will be available in 7.2.7.

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 10 Commit Notification 2022-04-18 16:16:25 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4845e68e6575030464c260406b667f0a51bf4a9e

tdf#142151: vcl_filters: Add unittest

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.
Comment 11 Commit Notification 2022-04-19 08:24:10 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dc97aac5cdfa3789d4e71e9d92df6e7e68802825

Following tdf#142151: Red cast rendered in 16 bit TIFF image

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.
Comment 12 Commit Notification 2022-04-27 10:24:01 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-3":

https://git.libreoffice.org/core/commit/46b316ee61657ab44e5dcb56ed66626d97f3c04a

tdf#142151: Red cast rendered in 16 bit TIFF image

It will be available in 7.3.3.

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 13 Julien Nabet 2022-04-27 11:33:47 UTC
Let's simplify a bit targets.
Comment 14 Commit Notification 2022-04-28 19:21:10 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/ab3bfc464f681c715f04b6c3135b850bab8576d3

Following tdf#142151: Red cast rendered in 16 bit TIFF image

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.