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 591102 - gdk_pixbuf_save() creates a zero-size file if it fails
gdk_pixbuf_save() creates a zero-size file if it fails
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-08-07 20:09 UTC by Jonh Wendell
Modified: 2010-07-10 04:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (598 bytes, text/x-c)
2010-01-15 13:01 UTC, Christian Dywan
  Details
Remove file if an error occurred (434 bytes, patch)
2010-01-15 13:06 UTC, Christian Dywan
committed Details | Review

Description Jonh Wendell 2009-08-07 20:09:19 UTC
if gdk_pixbuf_save() fails to save a pixbuf, it returns FALSE and fills a GError variable. However the file is still created with a size of zero.

Ideally it should only create the target file if the operation was successfully.
Comment 1 Christian Dywan 2010-01-15 13:01:07 UTC
Created attachment 151466 [details]
test case
Comment 2 Christian Dywan 2010-01-15 13:06:01 UTC
Created attachment 151469 [details] [review]
Remove file if an error occurred

This patch modifies gdk_pixbuf_save to remove the file if saving failed. Unfortunately loaders rely on the existence of the file, so I don't think we can avoid creating the file altogether.
Comment 3 Christian Dywan 2010-01-25 09:45:57 UTC
Pushed to master.