Bug 156652 - Export to pdf expands compressed Images if "Lossless" is chosen
Summary: Export to pdf expands compressed Images if "Lossless" is chosen
Status: RESOLVED DUPLICATE of bug 99887
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Image-Compression-Dialog
  Show dependency treegraph
 
Reported: 2023-08-07 09:59 UTC by Jens-D Doll
Modified: 2023-09-13 06:21 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample for Export to pdf (167.35 KB, application/vnd.oasis.opendocument.text)
2023-08-08 17:13 UTC, Jens-D Doll
Details
with compression (53.79 KB, image/jpeg)
2023-08-09 07:15 UTC, Jens-D Doll
Details
lossless (55.14 KB, image/jpeg)
2023-08-09 07:15 UTC, Jens-D Doll
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens-D Doll 2023-08-07 09:59:23 UTC
I wrote a document with 3 images inserted. After exporting it the size grew from 750 kB in *.odt to 5 MB in *.pdf.
Comment 1 raal 2023-08-08 16:59:06 UTC
Hello,

Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document.
(Please note that the attachment will be public, remove any sensitive information before attaching it.)
How can I eliminate confidential data from a sample document?
https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F
Thank you
Comment 2 Jens-D Doll 2023-08-08 17:08:21 UTC
It's also a matter of configuration. We have got 2 places to start the export to pdf. One of them has an icon which you can click on and the other is a menu item under file->export as->export as pdf. Latter one enables you to chose the compression rate. Chosing jpg-compression makes the file a lot smaller afterwards.
Comment 3 Jens-D Doll 2023-08-08 17:13:04 UTC
Created attachment 188854 [details]
Sample for Export to pdf
Comment 4 QA Administrators 2023-08-09 03:14:10 UTC Comment hidden (obsolete)
Comment 5 Robert Großkopf 2023-08-09 07:01:17 UTC
Changed the component, has nothing to do with Base (database component).

Then I tested the attached file (here with OpenSUSE 15.4 64bit rpm Linux and LO 7.5.5.2).
Exporting the example file (167,4 kB) will show a *.pdf-file with 72,3 kB. So I couldn't find any buggy behavior.

Please start File → Export As → Export As PDF and make a screenshot form PDF Options → General. Attach this screenshot here to have a look on the options you have chosen.

PDF-Options here: 
Range → All (all other options aren't chosen)
Images → JPEG Compression : 90%
Images → Reduce Image Resolution : 150 dpi
Watermark isn't chosen
General → Create PDF Form (all other options aren't chosen)
Structure → Export outlines (all other options aren't chosen)
Comment 6 Jens-D Doll 2023-08-09 07:15:12 UTC
Created attachment 188862 [details]
with compression
Comment 7 Jens-D Doll 2023-08-09 07:15:30 UTC
Created attachment 188863 [details]
lossless
Comment 8 Jens-D Doll 2023-08-09 07:16:01 UTC
have a look at the difference in the options
Comment 9 Robert Großkopf 2023-08-09 07:52:42 UTC
OK, with 
Images → Lossless compression
I will get a file of 485 kB.
But: I copied the image to GIMP and exported it there without compression to JPG. Got 463,9 kB.

So this is the same the export does.

We could say: Lossless compression shouldn't be available for images, which are included in the *.odt-file, because the images are just compressed in this file. The image you included is saved as 157,6 kB file (inside the odt-document) and will be blown up 463,9 kB. 

The export should better read the compression of the image and write it into *.pdf file with this compression if you choose "Lossless".

This bug might be an enhancement, but the behavior at this moment is the behavior as I would expect.
Comment 10 Jens-D Doll 2023-08-09 07:56:34 UTC
This bug is a severe trap, because you do not expect that the size of the image inserted becomes multiplied when exporting. There is no reason to expand a compressed image under option 'lossless', because it does not yield more information.
Comment 11 Robert Großkopf 2023-08-09 08:59:51 UTC
I will set this one to NEW. Expanding a compressed image isn't expected with "lossless compression" chosen. There is no more information available as it is saved in the image inside the *.odt-file.
Comment 12 Jens-D Doll 2023-08-09 09:33:35 UTC
Not expanding a jpg-file is also lossless, because nothing is gained by expansion.
Comment 13 Jérôme 2023-08-09 20:02:18 UTC

*** This bug has been marked as a duplicate of bug 99887 ***
Comment 14 QA Administrators 2023-08-10 03:05:57 UTC Comment hidden (obsolete)
Comment 15 Buovjaga 2023-09-13 06:21:04 UTC

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