Bug 155444 - Support opening TIFF image containing multiple images in Draw showing one image per page
Summary: Support opening TIFF image containing multiple images in Draw showing one ima...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Padia Rashesh
Whiteboard: target:24.2.0 inReleaseNotes:24.2
Keywords: difficultyInteresting, easyHack
: 63722 (view as bug list)
Depends on:
Blocks: Draw-Images Images-TIFF
  Show dependency treegraph
Reported: 2023-05-23 07:30 UTC by Tomaz Vajngerl
Modified: 2024-01-26 08:31 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

Multi-page TIFF with 16 pages (181.40 KB, image/tiff)
2023-06-01 04:19 UTC, Tex2002ans

Note You need to log in before you can comment on or make changes to this bug.
Description Tomaz Vajngerl 2023-05-23 07:30:20 UTC
When opening a PDF in Draw with PDFium support (with env var LO_IMPORT_USE_PDFIUM=1), it will open the PDF showing one PDF page per Draw page . Tiff format can also contain multiple images and it would be great if Draw can support opening such Tiff image where each image will be shown in its own Draw page.

The opening of the Tiff file is handled in [1]. The way how this is implemented for PDF is located at [2]. Probably this also needs extending the way how we handle and store multiple images for the tiff file inside Graphic object, so it is similarly handled as a PDF format.   

[1] https://cgit.freedesktop.org/libreoffice/core/tree/sd/source/filter/grf/sdgrffilter.cxx
[2] https://cgit.freedesktop.org/libreoffice/core/tree/vcl/source/filter/ipdf/pdfread.cxx:348
Comment 1 Caolán McNamara 2023-05-23 08:50:55 UTC
I think right now that a multi image tiff is imported as a Graphic with IsAnimated() set to true and each image as an animation frame.


So could use Graphic::GetAnimation().Count() for count of images with Graphic::GetAnimation().Get(index).maBitmapEx to get each of the individual images out of it
Comment 2 Tex2002ans 2023-06-01 04:19:33 UTC
Created attachment 187633 [details]
Multi-page TIFF with 16 pages

Here is a sample multi-page TIFF provided by vimal7370, a user at the Collabora forums who first brought up this issue:


Opening this TIFF in LO Draw only leads to a single page shown.
Comment 3 Padia Rashesh 2023-06-02 09:28:41 UTC
Pushed a patch: https://gerrit.libreoffice.org/c/core/+/152550
Comment 4 Padia Rashesh 2023-06-07 09:25:01 UTC
The final patch: https://gerrit.libreoffice.org/c/core/+/152693
Comment 5 Commit Notification 2023-06-08 12:31:15 UTC
rash419 committed a patch related to this issue.
It has been pushed to "master":


tdf#155444 added support for multi image tiff file

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Caolán McNamara 2023-07-03 08:43:04 UTC
I see the example tiff opens in draw now with multiple pages
Comment 7 Aron Budea 2023-07-03 11:15:25 UTC
*** Bug 63722 has been marked as a duplicate of this bug. ***
Comment 8 Ulf Zibis 2023-07-08 16:40:48 UTC
(In reply to Commit Notification from comment #5)
> It will be available in 24.2.0.

What about is this version?
I have LO
Comment 9 Tomaz Vajngerl 2023-07-09 02:57:14 UTC
Only bugfixes go into LibreOffice 7.5 - this is new functionality.
Comment 10 Ulf Zibis 2023-07-09 18:39:25 UTC
Well besides I do not understand, why not opening a tiff file completely is not valued as a bug, I'm still not able to contextualise version 24.2.0 in relation to 7.5.
Comment 11 Aron Budea 2023-07-09 22:32:34 UTC
(In reply to Ulf Zibis from comment #10)
> Well besides I do not understand, why not opening a tiff file completely is
> not valued as a bug, I'm still not able to contextualise version 24.2.0 in
> relation to 7.5.

Bug is when the code implementing the behavior is there, but isn't working correctly. Feature is when the code isn't there at all.

24.2.0 is the version in development, to be released in February 2024 (ie. in the version number 24 corresponds to 2024, and 2 corresponds to February). Daily builds are already available, I wouldn't suggest those for production use in general, but they should be perfectly fine for checking out a new feature or a fix.
Comment 12 Stéphane Guillou (stragu) 2024-01-26 08:31:29 UTC
In release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.2&type=revision&diff=730913&oldid=730903

Verified in:

Version: (X86_64) / LibreOffice Community
Build ID: b1fd3a6f0759c6f806568e15c957f97194bbec8f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Padia Rashesh! (Can you please check I've got your name in the right order in the release notes?)