Bug 115808 - Impress displays images differently on different machines (screen resolutions?)
Summary: Impress displays images differently on different machines (screen resolutions?)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.4.5.1 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 116164 (view as bug list)
Depends on:
Blocks: Impress-Images Image-DPI
  Show dependency treegraph
 
Reported: 2018-02-17 16:03 UTC by Eric M
Modified: 2018-08-07 18:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
before forcing redraw of the slides in slide sorter (988.78 KB, image/png)
2018-03-07 17:40 UTC, Eric M
Details
after forcing redraw of the slides (1.02 MB, image/png)
2018-03-07 17:41 UTC, Eric M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric M 2018-02-17 16:03:19 UTC
When inserting and cropping images (they don't always have to be cropped for this to happen) in a presentation on one machine and then opening the same .odp file on another machine with the exact same Linux OS and exact same version of LO, the figures appear mangled. Not every single figure is affected this way, but usually a number of them are. In some cases it is both in the 'slide sorter' view and also in the 'normal view' of the slide. The 'slide sorter' thumbnails get redrawn after working with the presentation and is merely annoying. When the problem affects the slide in 'normal view' it's a deal breaker of a problem.

This has been a long standing issue (many many years through StarOffice, OpenOffice, Apache OpenOffice, and now LibreOffice). I have posted bug reports before on this, but the problem persists and makes Impress extremely painful to use.

The post here on the Apache OO forum may be the underlying issue, but I don't know because I don't know how LO Impress deals with inserted figures, or figures from other slides that are 'imported' and so on.

https://forum.openoffice.org/en/forum/viewtopic.php?f=10&t=73858

I try to always crop images outside of Impress and only import them after, but this doesn't solve the problem. I have generally noticed that if I import slides from .ppt or .pptx that the images import correctly in the LO Impress session, but as soon as I save as .odp and reopen, either on a different machine or the same machine, the images will be distorted. 

I have a lot of general questions:

1. How does Impress read image data on an import of say .jpg or .png?
2. How does Impress save this data in the .odp file?
3. How does Impress read image data on an imported SLIDE from another Impress presentation?
4. How does Impress read image data on an imported SLIDE from a .ppt or .pptx presentation?
5. Is the screen resolution ever taken into account when doing any of the above?

This issue is a show stopper for me and it really makes Impress unusable for scientific presentations where there are multiple figures on every slide. If I understand the answers to some of the questions above I may be able to provide much better bug reports.

Finally, can I work directly with one of the developers who knows the internals to help debug this issue?

-EM
Comment 1 Eric M 2018-02-17 22:32:08 UTC
The following steps *might* mitigate the problem, but are certainly not ideal.

1. For an existing image in a presentation, right click on an image and select "Compress". Then **deselect** "Reduce image resolution". Then select "OK".

2. Crop as needed. Then do all of (1) again.

3. When importing new images, follow the steps in (1), crop as needed, and again do (1).

Finally, even if one follows the steps above and the images display correctly on the slide view, they are still typically mucked up on the 'slide sorter' view. The slide thumbnails are redrawn at some point in working with a presentation and then look fine, but the redrawn thumbnails are lost on closing the .odp.

The resolution to these two problems seems like it might be relatively quick for a developer who knows the code.

A. Why not, when importing new images just go through the compression steps listed above?  Whatever that does internally in the .odp appears to work in most cases.

B. To solve the 'slide sorter' view problem, why not just redraw all the thumbnails whenever a presentation is opened?
Comment 2 Eric M 2018-02-19 00:26:20 UTC
One last comment is that if an .odp presentation with mangled *slide sorter* images is saved in .ppt format, and opened again with LibreOffice, the slide sorter view of the .ppt slides is fine, the thumbnails are sharp and the images are not mangled. For this to work the slides have to be OK in the normal slide view, fixed by the methods in my comment 1.
Comment 3 Eric M 2018-02-19 15:25:48 UTC
Here is a macro that forces LO to redraw the slide thumbnails. This is poorly written, and simply loops through the slides and will copy, paste, and delete each one. I don't what call I need to just force a redraw of the thumbnail, but this works. For some reason this only works if you are in the 'slide sorter' view.

REM  *****  BASIC  *****
REM  * You must be in 'slide sorter' view for this to work!!
REM

Sub refresh

msg = "Starting refresh..."

oDoc = ThisComponent
oSlideList = oDoc.getDrawPages()

REM loop through all slides and copy, paste, delete each one

For i = 0 to oDoc.getDrawPages().Count-1

oSlide = oSlideList.getByIndex(i)
REM msg = msg & "get slide : " & i

oController = oDoc.CurrentController
REM oCurrentPage = oController.CurrentPage
oDispatch = createUnoService( "com.sun.star.frame.DispatchHelper")
oProvider = oController.Frame
oDispatch.executeDispatch(oProvider, ".uno:Copy","", 0, Array())
oDispatch.executeDispatch(oProvider, ".uno:Paste", "", 0, Array())
oDispatch.executeDispatch(oProvider, ".uno:Delete","", 0, Array())

Next i

REM msgbox msg

End Sub
Comment 4 Buovjaga 2018-03-07 16:15:29 UTC
Could you attach a screenshot of the mangled state?
You said "I have posted bug reports before on this" - could you provide links to these reports?

There is currently ongoing work regarding the handling of bitmaps. You might want to test a daily build.
https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@70-TDF/current/
https://wiki.documentfoundation.org/Installing_in_parallel/Linux
Comment 5 Eric M 2018-03-07 17:40:16 UTC
Created attachment 140451 [details]
before forcing redraw of the slides in slide sorter

I have attached two png files. first.png shows the slides in slide sorter as opened from a .odp file. After I run the macro above to force it to redraw the slides, it becomes the after.png.
Comment 6 Eric M 2018-03-07 17:41:02 UTC
Created attachment 140452 [details]
after forcing redraw of the slides
Comment 7 Eric M 2018-03-07 17:44:56 UTC
My previous bug reports 108879 and 111340 were related to this bug, but those are largely solved by following the steps I outline here.
Comment 8 Buovjaga 2018-03-08 10:40:05 UTC
*** Bug 116164 has been marked as a duplicate of this bug. ***
Comment 9 Buovjaga 2018-03-08 10:40:45 UTC
NEW per dupe