Bug 166930 - ODG save is 23,8 MB, when inserting a image PDF of around 23,8 MB; However it can apparently be compressed to 500 KB at PNG level 1
Summary: ODG save is 23,8 MB, when inserting a image PDF of around 23,8 MB; However it...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-09 18:14 UTC by Telesto
Modified: 2025-06-09 19:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot Compress Dialog (26.96 KB, image/jpeg)
2025-06-09 18:24 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2025-06-09 18:14:13 UTC
Description:
ODG save is 23,8 MB, when inserting a image PDF of around 23,8 MB; However it can apparently be compressed to 500 KB at PNG level 1

Steps to Reproduce:
1. Download attachment 201165 [details]
2. Insert -> Image -> Select the PDF
3. Save as ODG
4. File -> Properties -> Notice the filesize of 23,8. Matching the size of the PDF; so not unreasonable on first impression
5. Right Click the Image -> Compress
6. the image size and the DPI have dropped significantly; However the file-size of the image is based the source PDF. 


Actual Results:
Large ODG size, which being incorrect accordingly to compress dialog

Expected Results:
Two options
1. Don't change source image dimensions and DPI (file should be 23,8 MB)
2. The image is actually being reduced to dimensions and DPI shown in the compress dialog. Filesize ODG should be +/- 300 KB


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 17e8dbead42e2d4b55815b1b7b2846b03d62a15d
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Mike Kaganski 2025-06-09 18:19:38 UTC
This makes absolutely no sense. If one format may be compressed to a particular size, it has nothing to do with another size. LibreOffice keeps the original, unmodified data when possible, to avoid data loss.
Comment 2 Telesto 2025-06-09 18:24:51 UTC
Created attachment 201166 [details]
Screenshot Compress Dialog
Comment 3 Telesto 2025-06-09 18:54:07 UTC
(In reply to Mike Kaganski from comment #1)
> This makes absolutely no sense. If one format may be compressed to a
> particular size, it has nothing to do with another size. LibreOffice keeps
> the original, unmodified data when possible, to avoid data loss.

Sorry, you're totally right. I didn't notice that the PDF being embedded into the ODG on Save.

However, there might still be something off: 

A) Draw compress dialog reporting an image filesize of: 23986 kb. The actual PNG shown on screen is 395.49 kb 794 x 1123  Pixels at 72 DPI (screen resolution) attachment 201166 [details]. So compress dialog is reporting image dimensions and DPI information from PNG. And filesize from PNG and PDF combined. 

B) Applying compress will delete the embedded PDF (does this count as dataloss or is this intentional?)

C) The PDF is embedded, however what's the intended goal? PDF appears unused and inaccessible, except by unzipping the ODG. If I increase the image after save the, 'thumbnail' of the PDF being used. The image isn't regenerated based on PDF.
Comment 4 Mike Kaganski 2025-06-09 19:09:30 UTC
(In reply to Telesto from comment #3)
> B) Applying compress will delete the embedded PDF (does this count as
> dataloss or is this intentional?)

Of course it's intentional. Compressing is necessarily destructive process, where you may change file format, dimensions, etc. to save space. If it weren't destructive, there would be no sense to not do it at all times.

> C) The PDF is embedded, however what's the intended goal? PDF appears unused
> and inaccessible, except by unzipping the ODG. If I increase the image after
> save the, 'thumbnail' of the PDF being used. The image isn't regenerated
> based on PDF.

It is used. Try printing.
Comment 5 Telesto 2025-06-09 19:19:57 UTC
(In reply to Mike Kaganski from comment #4)
Ah, OK. Thanks for the explanation!