Bug 90010 - Images embedded in password protected document are lost on save
Summary: Images embedded in password protected document are lost on save
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.4.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: highest major
Assignee: Not Assigned
URL:
Whiteboard: target:4.5.0 target:4.4.2
Keywords: bibisected, bisected, regression
: 90034 (view as bug list)
Depends on:
Blocks: mab4.4
  Show dependency treegraph
 
Reported: 2015-03-14 21:34 UTC by Peter Ryan
Modified: 2015-12-17 08:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
file with picture, password "a" (337.71 KB, application/vnd.oasis.opendocument.text)
2015-03-17 05:20 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Ryan 2015-03-14 21:34:43 UTC
Images inserted into a document (I've tried Writer and Calc) that are saved in their default open-document format (.odt / .ods) with a password, will show "Read-error" where the image should be when they are subsequently re-opened.

To recreate:
 * Start Writer with a blank document
 * Insert an image to be embedded (not linked)
 * Save document with a password.
 * Close Writer, re-open the document and observe the image does not appear, but a box with "Read-error" is in it's place.

I have tried opening older .odt documents with passwords, and these open correctly with images intact. If I try to re-save these documents under a different filename, with a password, they will also fail to retain their images.

So the bug _appears_ to occur during document save.

OS: Ubuntu 14.04 x86-64
LibreOffice: 4.4.1.2  Build ID: 40m0(Build:2) installed using ppa:libreoffice/ppa

Possibly the severity of this bug is critical because it results in data loss. In my own case, I didn't realise this was happening and I have saved documents that previously contained images that are now lost.
Comment 1 raal 2015-03-16 12:19:44 UTC
I can not confirm with LO  4.4.1.2, win7. PNG image.
Comment 2 Peter Ryan 2015-03-17 00:35:02 UTC
I just tried a PNG and it also worked perfectly. Then tried again with a Jpeg (a different one from before) and it failed.

I shouldn't have assumed it would be all image types!
Comment 3 raal 2015-03-17 05:19:15 UTC
I can confirm with Version: 4.5.0.0.alpha0+
Build ID: 7f3628e54d4470cac6d51659d1b1bec5fb4f4e70
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-03-14_00:35:32

JPG image

When I click on picture(read error) and select compress image from menu then LO crash.
Dataloss, higher importance. Works OK in LO 4.3-> regression
Comment 4 raal 2015-03-17 05:20:35 UTC
Created attachment 114142 [details]
file with picture, password "a"
Comment 5 Matthew Francis 2015-03-17 09:22:08 UTC
This seems to have begun at the below commit.
Adding Cc: to matus@libreoffice.org; Could you possibly take a look at this? Thanks

    commit 0843ade74e5848c0babad509b10c334b01847be2
    Author:     Matúš Kukan <matus.kukan@collabora.com>
    AuthorDate: Wed Nov 12 21:25:55 2014 +0100
    Commit:     Matúš Kukan <matus.kukan@collabora.com>
    CommitDate: Mon Nov 17 10:49:24 2014 +0100
    
        package: Do not bother with deflating jpeg images
    
        It takes a lot of time and we can save ~1% of size if at all. Rather
        store them uncompressed in the zip file.
        With png, we can save a bit more, although it's still only about 4% - 8%?
    
        Change-Id: I43a3e3812882e4ce85e7af9d0aaab454d98c4860
Comment 6 Allan Ryan 2015-03-18 08:26:12 UTC
I can Confirm this bug as I am having such problems with version 4.4.12. I think this bug started with version 4.4. I don't remember having this issue with version 4.3

At first I thought it was my images. But they are saved locally on my storage drive and I only use JPG and PNG. I tried and tested both as I thought that it was a file format issue. Most of the images are from the web, so it's mixed JPG and PNG.

I did not thought about the password though. All my ODT files are password protected as I share my computer with my sister. I didn't think that it would cause such an issue.

This is a critical bug since loosing images that I attach to reports for clients and customers will be gone and re-attaching takes time.

I'm running Windows 7 Pro 64-bit and LO 4.4.12

I'm hoping that it will get fixed soon in the following RC.

Thank you very much ^_^
Comment 7 raal 2015-03-18 09:08:00 UTC
*** Bug 90034 has been marked as a duplicate of this bug. ***
Comment 8 Joel Madero 2015-03-18 14:09:31 UTC
Good MAB candidate. Regression, bibisected, QA has done everything it can. Adding now.
Comment 9 Matúš Kukan 2015-03-19 15:57:35 UTC
(In reply to Matthew Francis from comment #5)
> This seems to have begun at the below commit.
>     commit 0843ade74e5848c0babad509b10c334b01847be2
>     Author:     Matúš Kukan <matus.kukan@collabora.com>
>     
>         package: Do not bother with deflating jpeg images
>     
>         It takes a lot of time and we can save ~1% of size if at all. Rather
>         store them uncompressed in the zip file.
>         With png, we can save a bit more, although it's still only about 4%
> - 8%?

Oh, what fun! Nice catch! I was not testing password protected documents.
OK, I will try to check what happens there. In worst case, my commit was just performance improvement and can be reverted (when storing with password).
Comment 10 Commit Notification 2015-03-25 20:35:55 UTC
Matúš Kukan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ca5ff4559726455d0c8fbdd08cb35af3308492bf

tdf#90010 Partially revert "package: Do not bother with deflating jpeg images"

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2015-03-25 21:55:01 UTC
Matúš Kukan committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=da651b6ccb47e82f71d890fc8bb9d6cf0201f289&h=libreoffice-4-4

tdf#90010 Partially revert "package: Do not bother with deflating jpeg images"

It will be available in 4.4.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Jean-Baptiste Faure 2015-03-26 05:44:53 UTC
Verified in master and in LibreOffice 4.4.3.0.0+ both built at home under Ubuntu 14.10 x86-64.
Thank you very much.

Best regards. JBF
Comment 13 Commit Notification 2015-03-26 08:47:57 UTC
Matúš Kukan committed a patch related to this issue.
It has been pushed to "libreoffice-4-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ae9434662a9165aa31575448bc577e4b48db753&h=libreoffice-4-4-2

tdf#90010 Partially revert "package: Do not bother with deflating jpeg images"

It will be available in 4.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Matúš Kukan 2015-03-26 08:54:23 UTC
This partial revert was in fact the right fix for this. I didn't realize that before. Anyhow, it's fixed now. Marking as such.
Comment 15 Jean-Baptiste Faure 2015-03-26 19:39:03 UTC
comment #12 -> verified

Best regards. JBF
Comment 16 Robinson Tryon (qubit) 2015-12-17 08:49:05 UTC Comment hidden (obsolete)