Bug 144553 - JPG and PNG and GIF get corrupted to zero size on export if resaved under the same name
Summary: JPG and PNG and GIF get corrupted to zero size on export if resaved under the...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
6.3.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2021-09-16 17:50 UTC by Daniel Baran
Modified: 2024-02-28 12:55 UTC (History)
3 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 Daniel Baran 2021-09-16 17:50:54 UTC
Description:
When I open a JPG and then export as JPG the result is a zero byte file.
This only happens when I overwrite to the original file name.
I have repeated this in several tests with different files.


Steps to Reproduce:
1.Open a JPG file
2.Export as JPG using the original file name
3.Agree to overwrite (per file exists warning)



Actual Results:
Output file is corrupted - byte size is zero


Expected Results:
Overwrite the original file with the modified version



Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.6.2 (x64) / LibreOffice Community
Build ID: 0e133318fcee89abacd6a7d077e292f1145735c3
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Timur 2021-09-17 09:31:00 UTC
In LO 6.2 error dialog "Writer error. File could not be written". 
Repro LO 6.3 and 7.3+ Windows and Linux.

In Linux 6.2 and 6.3 and 6.4 master there's a crash on save, so bibisect should be done in Windows.
Comment 2 Timur 2021-09-17 10:11:40 UTC
May be the same bug: when PNG Options appear, see size, click in Resolution field, see that size becomes 0.
Comment 3 Henrik Palomäki 2021-09-21 07:15:20 UTC
Should the wanted behaviour be similar for example to the GIMP's export tool? It overwrites the file that has a same name. Or is it enough to show an error dialog and leave the file intact?
Comment 4 Daniel Baran 2021-09-21 17:15:20 UTC
I think the current message dialog is proper.
That is: "filename.jpg already exists.  Do you want to replace it?"
But presently, if you reply "yes" to overwrite, you get a zero byte file.
Comment 5 Daniel Baran 2021-10-04 17:45:07 UTC
Assuming there may be good reasons to avoid overwriting the open file,
a good alternative might be changing the message box to something like:
"filename.jpg already exists - choose a new filename."
Comment 6 QA Administrators 2023-10-05 03:19:54 UTC Comment hidden (obsolete)
Comment 7 Daniel Baran 2023-10-05 21:48:07 UTC
Per QA Team request:
Using the version below, I still see the same behavior.
If I export to a new filename, the file is good.
If I export to the same filename the file is zero bytes.
Hope this helps.
 

Version: 7.5.6.2 (X86_64) / LibreOffice Community
Build ID: f654817fb68d6d4600d7d2f6b647e47729f55f15
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 8 Daniel Baran 2023-10-05 22:47:25 UTC
Adding:
I'm seeing the same behavior in the following versions as well.
Export to a new filename, the file is good.
Export to the same filename the file is zero bytes.

Version: 7.5.7.1 (X86_64) / LibreOffice Community
Build ID: 47eb0cf7efbacdee9b19ae25d6752381ede23126
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 9 Stéphane Guillou (stragu) 2024-02-28 12:55:26 UTC
reproduced with recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a1a1d8edb9d4a62b747aa7069b3026e2ba75704d
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded