Bug 118182 - LibreOffice says "Unknown image format" when trying to insert a JPEG TIFF with YCbCr colorspace
Summary: LibreOffice says "Unknown image format" when trying to insert a JPEG TIFF wit...
Status: RESOLVED DUPLICATE of bug 94372
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Images-TIFF
  Show dependency treegraph
 
Reported: 2018-06-15 15:44 UTC by Buovjaga
Modified: 2022-04-19 08:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example TIFF file (26.35 KB, image/tiff)
2018-06-15 15:44 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2018-06-15 15:44:36 UTC
Created attachment 142779 [details]
Example TIFF file

Try to insert the attached file to any LibO application.
It is taken from http://maptools-org.996276.n3.nabble.com/JPEG-compressed-RGB-tiled-TIFF-with-chroma-subsampling-tp14062p14076.html

Original investigation concerned this file: http://forumooo.ru/index.php?action=dlattach;topic=7201.0;attach=12329

Confirmed by kompi already with the forumooo.ru file.

Thanks to boud of Krita for help. Boud commented:
"krita does support YCbCrA, but other applications will automatically convert it to rgb. But because there are no free ycbcra profiles, we don't ship them. If the user downloads one from somewhere, this image can be loaded without conversion"

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 0d2c5e0838906101e1fdea93b4a0c422690e331c
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 15th 2018

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 90e4c55d01637178418c33ffe818263114a53374
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-11_23:27:09
Locale: fi-FI (fi_FI); Calc: group threaded
Comment 1 Telek 2020-07-05 10:44:25 UTC
Same problem confirmed on version
Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.10


@Buovjaga, could you explain more how to work around this bug ?
Comment 2 Buovjaga 2020-07-05 13:37:53 UTC
(In reply to Telek from comment #1)
> Same problem confirmed on version
> Version: 6.0.7.3
> Build ID: 1:6.0.7-0ubuntu0.18.04.10
> 
> 
> @Buovjaga, could you explain more how to work around this bug ?

I don't know how to work around this bug.
Comment 3 John 2021-06-13 00:58:00 UTC
I don't think this is a colorspace issue. For a quick test, I used imagemagick to generate ten TIFF files with the various compression options via this command:

> for i in None BZip Fax Group4 JPEG JPEG2000 Lossless LZW RLE Zip; do magick rose: -format tiff -resize 300% -compress $i rose_"$i".tiff; done

The resultant files had the following colorspaces:


rose_BZip.tiff sRGB
rose_Fax.tiff Gray
rose_Group4.tiff Gray
rose_JPEG2000.tiff sRGB
rose_Lossless.tiff sRGB
rose_RLE.tiff sRGB
rose_JPEG.tiff sRGB
rose_LZW.tiff sRGB
rose_None.tiff sRGB
rose_Zip.tiff sRGB


All but the zip and jpeg versions were able to be imported into a LibreOffice document. Those two gave the "Unknown image format" error. If I convert them to YCbCr or CMYK colorspace, they still don't open, but an uncompressed version in that colorspace will.
Comment 4 Julien Nabet 2022-04-19 08:26:23 UTC
The pb is JPEG compression isn't taken into account in LO.

Now after reading https://en.wikipedia.org/wiki/TIFF, and this part specifically:
"TIFF is a complex format, defining many tags of which typically only a few are used in each file. This led to implementations supporting very varying subsets of the format, a situation that gave rise to the joke that TIFF stands for Thousands of Incompatible File Formats", it's understandable...

IMHO, we should use a lib like libtiff to deal with tiff files but it still requires lots of work (see comments in https://gerrit.libreoffice.org/c/core/+/133108)

*** This bug has been marked as a duplicate of bug 94372 ***