Bug 117125 - Libreoffice stores same png multiple times
Summary: Libreoffice stores same png multiple times
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.3.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-20 13:40 UTC by Callegar
Modified: 2018-04-23 15:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test case (478.17 KB, application/vnd.oasis.opendocument.presentation)
2018-04-21 13:31 UTC, Callegar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Callegar 2018-04-20 13:40:51 UTC
Description:
If a picture is included multiple times in a presentation (i.e., because it is placed in one slide and then copied to another one), Libreoffice should store it only once in the odp file. However, if a png image appears in multiple places with different cropping, it gets saved multiple times. This is quickly verified by opening the odp file with a zip tool and noticing that in the picture folder there are multiple elements with the same checksum.

Seen on 6.0.3.2 and 6.0.4.1. This does not seem to be a regression because the same happens also with LibO 5.4. 

Steps to Reproduce:
See description

Actual Results:  
See description

Expected Results:
See description


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: StartModule
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Regina Henschel 2018-04-20 19:43:23 UTC
I cannot confirm your observation. For me the picture is only one time in the document. Which file format do you use?

Please attach a document, which is generated as you have described it, and without additional content.
Comment 2 Callegar 2018-04-21 13:31:48 UTC
Created attachment 141522 [details]
test case

Please, check the Picture folder in this odp to see two identical pngs.
Comment 3 Telesto 2018-04-21 16:23:54 UTC
There is a duplicate in the attached file However, I'm not able to reproduce this from scratch with
Version: 6.1.0.0.alpha0+
Build ID: 9c4eaa7b81a40d97fe49b85272b40bfeaaf44f86
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-04-16_03:31:36
Locale: nl-NL (nl_NL); Calc: CL
Comment 4 Callegar 2018-04-21 18:00:55 UTC
File was first obtained with 6.0.3.2.

Then the behavior was replicated with 6.0.4.1

1) opened file
2) opened an empty drawing
3) copied first instance of the png image and pasted to the empty drawing
4) deleted both instances of the png image from the presentation
5) saved
6) verified that both instances were gone from the odp
7) copied back instance from the drawing and adjusted the cropping
8) copied again as a second instance and adjusted the cropping here too
9) saved again
10) verified that once more the odp has two identical instances of the odp.
Comment 5 Buovjaga 2018-04-23 12:03:17 UTC
Sergio: there has been a bitmap handling renovation. Would you like to try with a fresh master build and try to repro from scratch: https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@70-TDF/current/
https://wiki.documentfoundation.org/Installing_in_parallel
Comment 6 Callegar 2018-04-23 14:51:54 UTC
At this point I managed making the duplicate go away even with 6.0.4.1 by removing one instance and copying the other.

With current master, simply opening the file and resavng it does not get rid of the extra png. However, the procedure in my past comment does.

So I think that the issue can be closed for now. I'll reopen it if I run again into the issue.
Comment 7 Buovjaga 2018-04-23 15:50:54 UTC
Cool, closing