Bug 108032 - PNGs are expanded 20 times on export (w/lossless!), leading to bloated PDFs.
Summary: PNGs are expanded 20 times on export (w/lossless!), leading to bloated PDFs.
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
5.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-23 16:50 UTC by agere
Modified: 2017-08-06 05:28 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description agere 2017-05-23 16:50:33 UTC
Today I’ve made a document, it’s resulting size was quite normal:

$ ls -s *odt 
5.9M Руководство по системе управления порталом.odt

All images are linked and reside under ‘img’ subfolder, which doesn’t take more than the document itself.

$ du -hs img/
2.1M	img/

And the resulting document takes… whooping 53 MiB(!).

$ ls -s Руководство\ по\ системе\ управления\ порталом.pdf 
53M Руководство по системе управления порталом.pdf

It was exported with PDF/A-a1 option, and I understand, that there are also fonts embedded into the doc, but that’s around 5 megabytes including all the variants (bold/italic), not more. Let’s export one image from a PDF viewer to disk and compare the size:

$ du -hb '/home/dtr/work/docs/website cms/platformiosedit.png'
1836974	/home/dtr/work/docs/alma tv/website cms/platformiosedit.png

$ du -hb '/home/dtr/work/docs/website cms/img/0250.png'
87942	/home/dtr/work/docs/website cms/img/0250.png

What?.. 

$ echo 'scale=1; 1836974/87942' | bc -q
20.8

Twenty, almost twenty one times bigger? What kind of archiving is that?
Let’s not use PDF/A-a1 and compare again

$ ls -s 'Руководство по системе управления порталом w\o PDF\A-a1.pdf'
2.0M Руководство по системе управления порталом w\o PDF\A-a1.pdf

Two megabytes! Two! As it should be. It is interesting to export that same iamge from the PDF viewer again.

$ du -hb 'platfromiosedit2.png'
91046	platfromiosedit2.png

Well, the size is bigger than that of the original image, but at least it’s close.

My question stays the same since #93462: why LibreOffice thinks, that it should modify original images, when it was clearly said to use Lossless images?
Comment 1 Telesto 2017-05-23 18:18:12 UTC
Looks quite similar to bug 104479
Comment 2 Xisco Faulí 2017-05-23 19:07:27 UTC Comment hidden (obsolete)
Comment 3 agere 2017-05-23 23:03:54 UTC Comment hidden (obsolete)
Comment 4 agere 2017-05-25 11:01:22 UTC
Somehow, removing ~/.config/libreoffice allowed Writer to run, and I could export the document again. 

$ du -hkx *pdf 
53460	Руководство по системе управления порталом.pdf
1676	Руководство по системе управления порталом test.pdf
53484	Руководство по системе управления порталом (LO 5.2.7.2).pdf
1952	Руководство по системе управления порталом w\o PDF\A-a1.pdf

As one can see, the PDF didn’t get any lighter, even got additional 24 KB to the old 53400.
Comment 5 Buovjaga 2017-06-04 12:19:03 UTC
Could you prepare a test package with all the files and attach it to this report?
Comment 6 Jean-Baptiste Faure 2017-08-05 21:17:40 UTC
Please answer Buovjaga's question from comment #5

Set status to NEEDINFO, please set it back to UNCONFIRMED once requested
informations are provided.

Best regards. JBF
Comment 7 agere 2017-08-05 21:48:38 UTC
Excuse me, I’m not interested in LO Writer any more. I was tired to deal with its problems and switched to Id.
Comment 8 Jean-Baptiste Faure 2017-08-06 05:28:13 UTC
Ok, closing.

Best regards. JBF