After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646371 - The wrong file gets saved when exporting with overwrite
The wrong file gets saved when exporting with overwrite
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other Linux
: Normal major
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2011-03-31 19:18 UTC by Einar Lielmanis
Modified: 2011-04-03 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix the overwrite behaviour (1.62 KB, patch)
2011-03-31 19:34 UTC, Einar Lielmanis
none Details | Review

Description Einar Lielmanis 2011-03-31 19:18:58 UTC
Problem:
- Open some foo.png
- File - Export to foo.jpg
- Now there are two items in the file menu: "Export to foo.jpg (Ctrl-E)" and "Overwrite foo.png".
- Choose "Overwrite foo.png"

Observed: foo.jpg gets overwritten

Expected: foo.png would be re-exported.
Comment 1 Einar Lielmanis 2011-03-31 19:34:18 UTC
Created attachment 184812 [details] [review]
Fix the overwrite behaviour

The GIMP_SAVE_MODE_EXPORT_TO was used for both Overwrite and Export for no good reason. Implement GIMP_SAVE_MODE_OVERWRITE and handle that correctly.
Comment 2 Martin Nordholts 2011-04-01 05:07:07 UTC
Looks generally sane, I will look closer at this before we release 2.8
Comment 3 Martin Nordholts 2011-04-03 14:58:56 UTC
Thanks for the patch, but there is actually a good reason to only have one constant, an image can never be considered both imported and exported at the same time, so I did another fix:

commit a8f552da2fb3887f75aa0c7502a54ddcd003e292
Author: Martin Nordholts <martinn@src.gnome.org>
Date:   Sun Apr 3 16:54:34 2011 +0200

    Bug 646371 - The wrong file gets saved when exporting with overwrite
    
    An image can not be considered both exported and imported at the same
    time, so stop consider it as imported after we consider it exported.
    
    Also add an automatic regression test.


the constant could use a better name though...
Comment 4 Martin Nordholts 2011-04-03 15:05:51 UTC
For reference: http://gui.gimp.org/index.php/Save_%2B_export_specification