Bug 43715 - Impress: presentation minimizer not reduces resolution of images (regression after 3.3)
Summary: Impress: presentation minimizer not reduces resolution of images (regression ...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected)
3.4.4 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
Keywords: preBibisect, regression
Depends on:
Blocks: Image-DPI
  Show dependency treegraph
Reported: 2011-12-11 06:09 UTC by Vincent Mabillot
Modified: 2021-06-14 09:54 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

A presentation impossible to reduce (2.56 MB, application/vnd.oasis.opendocument.presentation)
2012-03-23 07:25 UTC, Vincent Mabillot
test presentation for experiment with minimizer (47.59 KB, application/vnd.oasis.opendocument.presentation)
2012-06-05 05:03 UTC, sasha.libreoffice
Before Minimizing (517.26 KB, application/vnd.oasis.opendocument.presentation)
2012-06-05 07:50 UTC, Vincent Mabillot
After Minimizing (Nov.2011) (226.28 KB, application/vnd.oasis.opendocument.presentation)
2012-06-05 07:53 UTC, Vincent Mabillot
This presentation will be only half minimized (5.98 MB, application/vnd.oasis.opendocument.presentation)
2015-07-18 18:17 UTC, Jean-Baptiste Faure
This presentation will be completely minimized (5.96 MB, application/vnd.oasis.opendocument.presentation)
2015-07-18 18:18 UTC, Jean-Baptiste Faure
Insert photo to minimize (39.74 KB, image/jpeg)
2016-03-18 16:34 UTC, marco.jj

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Mabillot 2011-12-11 06:09:09 UTC
When I try to minimize a presentation, I could change each options, there's no reduction of the siez.
The presentation wizard tell me that my presentation 3,5Mo will be reduce to 1,1 Mo but at the end it still 3,5 Mo.

Browser: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0
Comment 1 sasha.libreoffice 2012-03-22 10:39:23 UTC Comment hidden (obsolete)
Comment 2 Vincent Mabillot 2012-03-23 07:25:18 UTC
Created attachment 58929 [details]
A presentation impossible to reduce

Nothing change with this presentation (I'll could attach other presentations if you want) Original : 2.6 Mo  projector presentation minimizing : 2.5Mo
Comment 3 sasha.libreoffice 2012-03-23 09:18:20 UTC
Thanks for attachment
I see that this presentation is initially compressed. So impossible reduce it's size again. Presentation minimizer intended for those user who places pictures directly from PhotoCamera (8 Megapixel) or Scanner into presentation. Then minimizer reduces size of file from 100 MB to 5 MB for example.

Problem is in another: why it shows estimates size of result without investigating of internals of presentation? In this case it estimates to obviously wrong result.

More simple solution: remove size estimation at all.
More complex: analysis of presentation before show resulting size
Comment 4 Vincent Mabillot 2012-03-26 00:35:00 UTC Comment hidden (obsolete)
Comment 5 Vincent Mabillot 2012-06-04 06:39:35 UTC
(In reply to comment #4)
> I think the more complex solution is better but a warning message could prevent
> users.

I try again to reduce the presentation (the same as in the attachement with a fresh 3.5.4 but nothing change.

Previously (month and month ago), when I used presentation minimizer, the reduction is not only a defintion reduction for pictures but a resolution reduction too.

Now, the endless size of a pictures is the same as the size of the original (source)picture. Before, the minimizer reduced the size of the picture to the size in the presentation. 

Example if I use a source with a 1024x768 picture and reduced its appearance to 640x480 in my presentation, if I try the function "restore original size", with the old minimizer extension, the size stay to 640x480 but now, using the same functionnality, the size is the original size 1024x768. 

I think it's the reason why the estimated size is wrong, because the pictures waqsn't resize to presentation's dimensions.
Comment 6 sasha.libreoffice 2012-06-05 00:38:35 UTC
Thanks for additional testing. I tried to reproduce bug from previous comment, but can not find, where to specify screen resolution in Impress. For example 1027x768 or 640x480. Please, tell where it is in Impress or attach screenshot of settings.
Comment 7 Vincent Mabillot 2012-06-05 03:53:35 UTC
Sorry the example of resolution... They made a new misinterpretation. It's not screen resolution but picture resolution.

I'll maybe used example such as the picture size 600x300 reduced freehand to 300x150 in the presentation...
Comment 8 sasha.libreoffice 2012-06-05 05:03:29 UTC
Created attachment 62576 [details]
test presentation for experiment with minimizer
Comment 9 sasha.libreoffice 2012-06-05 05:07:55 UTC
Indeed, not minimizes. May be minimizer thinks that 1024x768 is already too small to minimize? I not experimented with big pictures.

If this functionality has working in previous version, it is important to determine, it which version. At least approximately.
Comment 10 Vincent Mabillot 2012-06-05 07:50:22 UTC
Created attachment 62587 [details]
Before Minimizing
Comment 11 Vincent Mabillot 2012-06-05 07:53:09 UTC
Created attachment 62588 [details]
After Minimizing (Nov.2011)

This is a minimized presentation (I think with a 3.3 version in november)
Comment 12 sasha.libreoffice 2012-06-05 22:50:45 UTC
Thanks for attachment. Presentation was minimized in 2011-11-14
on LibreOffice/3.3$Linux LibreOffice_project/330m19$Build-8
So, regression happens somewhere between 3.3 and 3.5
Comment 13 Vincent Mabillot 2012-06-06 00:42:35 UTC Comment hidden (obsolete)
Comment 14 Vincent Mabillot 2012-06-06 00:46:34 UTC
I think the regression happened beetween 3.3 and 3.4.4 (see the history of the bug).

It maybe appeared when minimizer was include in the pack.

In my memories : Before I installed the extension directly from libre office extension manager after downloaded from openoffice extension repository.
Comment 15 Julien Nabet 2012-11-01 08:20:25 UTC
On pc Debian x86-64 with master and 3.6 sources both updated yesterday, I could minimize the presentation.
I noticed this kind of logs:
 warn:legacy.osl:10929:1:/home/julien/compile-libreoffice/libo/xmloff/source/draw/shapeexport.cxx:719: XMLShapeExport::exportShape(), exception caught!

MagicVince: could you give a try to a newer LO version (3.5.7 or 3.6.2)?
Comment 16 sasha.libreoffice 2012-11-01 08:41:21 UTC
Experimented with second attachment in 3.6.2 on RFR 17 64bit
The same result. After minimizing picture remains 1024x768pixels, though it takes small part of slide in presentation, therefore it's resolution should be reduced.
Comment 17 Julien Nabet 2012-11-01 09:42:07 UTC
Thank you Sasha for your feedback, I tested your attachment (https://bugs.freedesktop.org/attachment.cgi?id=62576) and reproduced the problem on master sources.
Comment 18 Michael Meeks 2012-12-18 15:48:09 UTC
Compression is based on a DPI calculation:

                                const double fSourceDPIX = ((double)aSourceSizePixel.Width / ((double)aLogicalSize.Width / 2540.0 ));
                                const double fSourceDPIY = ((double)aSourceSizePixel.Height/ ((double)aLogicalSize.Height/ 2540.0 ));

                                // check, if the bitmap DPI exceeds the maximum DPI
                                if( ( fSourceDPIX > rGraphicSettings.mnImageResolution ) || ( fSourceDPIY > rGraphicSettings.mnImageResolution ) )

Might be good to run through the sdext/source/minimizer/impoptimizer.cxx (ImpCompressGraphic) method in a debugger for this image and see what is going on.

Potentially there might be some horror mapmode problem causing grief. I need to re-build with the extension enabled to do more it seems.
Comment 19 Robinson Tryon (qubit) 2013-10-19 00:25:10 UTC Comment hidden (obsolete)
Comment 20 Jean-Baptiste Faure 2013-10-19 07:12:09 UTC
In fact Presentation Minimizer fails to reduce pictures that are added in a slide with the layout "Title, Content" by clicking on the "Insert Picture" button which is _in the slide_.
If you insert a picture in a slide with the layout "Blank slide" using the button "From File" which is _in the toolbar_, then Presentation Minimizer reduces this picture without problem.

Steps to reproduce:
You need 2 (different) pictures, for example 2 photos, size ~3 MB each.
1/ create a new empty presentation
2/ chose the layout "Blank Slide"
3/ in the toolbar Drawing click on the button "From File", choose the first picture
4/ add a new slide and click on the layout "Title, Content"
5/ in the center on this new empty slide you have a button with 4 actions; click on "Insert Picture" and choose the second picture
6/ save your presentation
7/ menu Tools > Minimize Presentation...
8/ choose the options which give the smallest size (default options for Screen Optimized)
9/ Presentation Minimizer says that the file size will reduce from ~ 6 MB to ~2 MB or less
10/ launch the minimization
You get a file with size ~ 3 MB. If you examine the minimized presentation you will see that only the first picture has been reduced. You can verify that by opening the file with your preferred archiver software (rename the .odp in .zip before).

Tested today in the master (Build ID: 8998a84f2a45f099981183fc7c6ba1d16a744414 after the de-extension-alization of Presentation Minimizer) and in LO

Best regards. JBF
Comment 21 Joel Madero 2013-10-29 21:11:50 UTC
Hm - I don't have presentation minimizer under Tools . . . was this removed in 4.1.2? I get it in bibisect package though and it seems like it never worked correctly since it was incorporated into core. Removing bibisectrequest as it's not useful in this situation
Comment 22 Julien Nabet 2013-10-29 21:40:26 UTC
Joel: on pc Debian x86-64 with 4.1 sources updated some days ago, I got "Minimize Presentation" on Tools (of course in Impress).
Comment 23 Joel Madero 2013-10-29 21:50:38 UTC
Very weird - my release and my master build (from just a few days ago) both don't have it under tools. What in the world - oh well, different issue I suppose. The important thing is bibisect isn't useful here - seems like it's been broken since the first introduction into our core code (no clue about when it was "just an extension")
Comment 24 Julien Nabet 2013-10-29 21:52:24 UTC
Joel: I forgot to say I got this in my autogen.input:
Comment 25 Joel Madero 2013-10-29 21:54:15 UTC
ah there's the answer ;) But it seems like it was taken out of the debian package at least from the Ubuntu ppa
Comment 26 retired 2014-12-17 09:27:57 UTC
What's up with this? Can someone post exact repro steps? Where is presentation minimizer. Everyone seems to know - nevertheless exact steps would be great.

Would be great to know where to even start when trying to reproduce.

Is this persisting with LO 4.4b2?
Comment 27 QA Administrators 2015-07-18 17:36:07 UTC Comment hidden (obsolete)
Comment 28 Jean-Baptiste Faure 2015-07-18 18:09:54 UTC
(In reply to foss from comment #26)
> What's up with this? Can someone post exact repro steps? Where is
> presentation minimizer. Everyone seems to know - nevertheless exact steps
> would be great.
> Would be great to know where to even start when trying to reproduce.
> Is this persisting with LO 4.4b2?

Nothing changed in LO and LO
Steps to reproduce : see comment #20
Presentation Minimizer is available in Impress under menu Tools > Minimize Presentation...

Best regards. JBF
Comment 29 Jean-Baptiste Faure 2015-07-18 18:17:07 UTC
Created attachment 117313 [details]
This presentation will be only half minimized
Comment 30 Jean-Baptiste Faure 2015-07-18 18:18:46 UTC
Created attachment 117314 [details]
This presentation will be completely minimized
Comment 31 marco.jj 2016-03-18 16:34:58 UTC
Created attachment 123696 [details]
Insert photo to minimize

The Impress tool "minimize presentation" don't work in this condition:

- when i insert the photo by new presentation sheet (see in the attachment).
When the tool try to remove the original image after compression they was locked, i think (only image inserted by a button in the center of a new sheet).

else, if i paste photo from memory or use "image" button or in menù "insert/image" the compression work correctly.
Comment 32 Xisco Faulí 2016-09-20 16:10:35 UTC
Adding keyword 'bibisectRequest' to see whether this regression is already present in the oldest build of bibisect-43all repository or not.
In case it's already present, change 'bibisectRequest' to 'preBibisect'.
Otherwise, change 'bibisectRequest' to 'bibisected' and add a comment with the output from 'git bisect log'
Comment 33 Xisco Faulí 2017-09-29 08:52:54 UTC Comment hidden (obsolete)
Comment 34 Jean-Baptiste Faure 2017-10-28 16:26:09 UTC
Still reproducible with LO 5.4.2 on test files from comment #29 and #30.

Best regards. JBF
Comment 35 QA Administrators 2019-06-03 02:49:10 UTC Comment hidden (obsolete)
Comment 36 QA Administrators 2021-06-03 03:55:14 UTC Comment hidden (obsolete)
Comment 37 Jean-Baptiste Faure 2021-06-13 16:34:51 UTC
Seams fixed somewhere : attachment https://bugs.documentfoundation.org/attachment.cgi?id=117313 is minimized by LO as attachment https://bugs.documentfoundation.org/attachment.cgi?id=117314 is.

Version: / LibreOffice Community
Build ID: 170f257ea5e3375257355def8bd7e998135ad98a
CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

It works the same way with master 
Version: / LibreOffice Community
Build ID: 6b349bcc32336664a31deed3f4463e40dd028f63
CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

Closing as WorksForMe. Please feel free to reopen if you disagree.

Best regards. JBF
Comment 38 Timur 2021-06-14 09:28:30 UTC
Seems that change was in 6.2 repo. 

commit a8dac79668df1b2ca127528c11fad3d024860a5a
Date:   Thu May 16 15:52:04 2019 +0200
    source 1bdbd26987c387dcee170775ecc1305be03669e1
    previous cde86a07bdd3534f75ec94955837812e2bbd24d4

author	Tamás Zolnai <tamas.zolnai@collabora.com>	2019-05-13 15:56:52 +0200
committer	Andras Timar <andras.timar@collabora.com>	2019-05-16 14:26:59 +0200
commit 1bdbd26987c387dcee170775ecc1305be03669e1 (patch)
tree 5baf28f57f85d9040ffe78f9c39cd92e8f83fb72
parent cde86a07bdd3534f75ec94955837812e2bbd24d4 (diff)
Presentation minimizer: Handle also presentation.GraphicObjectShape URL

Thanks to Tamás.