Failing to replace a file (e.g. ICO cannot be >255px) will end up deleting the original file

Bug #1888141 reported by Stdedos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Triaged
Medium
Unassigned

Bug Description

Repro:

1. Save a file with name ~/a.ico
2. Load a >256x256px file
3. Save the file with name ~/a.ico

Expected:
File cannot be saved, file ~/a.ico is not touched

Actual:
File cannot be saved, file ~/a.ico is removed

Tags: easy-to-fix
Revision history for this message
Cameron White (cameronwhite91) wrote :

Confirmed.

It seems to be an issue with an error occurring in Pixbuf.Save(). In the specific case of .ico files we could check the size ahead of time instead of waiting to catch an exception, but more generally it seems like we might need to save to a temp file or something like that first to be on the safe side.

Changed in pinta:
importance: Undecided → Medium
status: New → Triaged
tags: added: easy-to-fix
Revision history for this message
Stdedos (stdedos) wrote :

Atomic saves (https://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file) are never bad

Please make sure you don't trash soft/hardlinks :-D

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.