Open image file - accidentally overwrite when save

Bug #715869 reported by pRototype
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Low
Unassigned

Bug Description

Inkscape version: inkscape_R10017-1101262125
OS: WIndows XP SP2

Reproduce bug:
I have a link to Inkscape on my desktop. From windows explorer I use to drag an image file (png) into Inkscape. I select "Link" to image file when question appear.
Then I create a background layer and put the image there, lock that layer and creates another one to draw on.

Then if I press Ctrl+S to save, Inkscape just overwrite the image file I dropped in. That means the original image file is now broken.

This bug may destroy image files if user isn't very aware og this.

Revision history for this message
su_v (suv-lp) wrote :

> From windows explorer I use to drag an image file (png) into Inkscape.

- Do you drag&drop the PNG into the Inkscape Window or just drop it onto the Inkscape icon on the desktop (which AFAIK will open the PNG file and not import it).
- What is displayed as file name in the Inkscape window title?

Revision history for this message
su_v (suv-lp) wrote :

> in the Inkscape window title?
I meant in the title bar of the window, before saving with 'Ctr+S'.

Revision history for this message
pRototype (regeir) wrote :

Hi.

I drag the png file on the Inkscape desktop icon.

The windows title yeld <FileName>.PNG

Just the same as the name of the file.

Revision history for this message
su_v (suv-lp) wrote :

> The windows title yeld <FileName>.PNG

So Inkscape does the correct think when 'Ctrl+S' is used: overwrite the existing file (since Inkscape supports saving as "Cairo PNG (*.png)" and you opened, not imported a PNG file).

Proposing to link as duplicate to
Bug #635373 “Opening PNG in Inkscape shows nonsense "png GDK pixbuf Input" alert”
<https://bugs.launchpad.net/inkscape/+bug/635373>
because the 'Link or Embed' dialog is - while IMHO technically correct - confusing in this situation.

Revision history for this message
su_v (suv-lp) wrote :

> (…) opened, not imported a PNG file

To import, use drag&drop onto the Inkscape canvas (not the application icon), 'File > Import…' or paste from the clipboard (Ctrl+V).

Revision history for this message
pRototype (regeir) wrote :

No.

In previous versions, I always dragged (opened) the png file I used as background image.

The way you propose is not a god workaround because the canvas will be default size (A4 sheet) while the file I dragged into will have another size.

Think of this: What is the purpose with the "Link or embed image" dialog box if there is no real alternative. It doesnt make any sense that a background file that is linked should potentially be overwritten by Inkscape.
As it happends to me: After that happens (Clicked Ctrl+S) then the linked image was totally destroyed.
Now I must do two things every time I will use a background image in Inkscape
* Remember to do Ctrl+Shift+S when saving first time.
* Make the background file write protected, as I'll probably forget to "Save AS".

Also, in previous versions of Inkscape, I've always dragged the background image into desktop icon.
However I never really noticed then windows title on those versions. But I know that Inkscape didn't use to behave this before. Previously I always get the Save file dialog box when I was saving (not save as).

The least the user should expect is to get a overwrite warning so user can prevent a situation when the original (file that is linked to) goes lost. It should be easy to make Inkscape check that it doesn't try to overwrite a file that is already linked to.

~Suv - you say Inkscape do the correct thing. No I'm disagree. Only when doing a Ctrl+Shift+E, I expect Inkscape to save as PNG file. I think when doing a regular save (Ctrl+S) only svg files should be allowed to save. Or it should be a setting for this in preferences dialog box.

I can always use an earlier version to get it to work like I'm used to. But I prefer to be updated in the progress and I hope a few bug reports from me can help to get rid of some annoying bugs.

Revision history for this message
su_v (suv-lp) wrote :

> Think of this: What is the purpose with the "Link or embed image"
> dialog box if there is no real alternative. It doesnt make any sense
> that a background file that is linked should potentially be
> overwritten by Inkscape.

That's what bug #635373 is about IMHO.

Revision history for this message
su_v (suv-lp) wrote :

> I think when doing a regular save (Ctrl+S) only svg
> files should be allowed to save.

Agreed - Inkscape has to reconsider 'Save vs. Export':

Blueprint: Sort out Save as vs Export formats
<https://blueprints.launchpad.net/inkscape/+spec/save-as-vs-export>
<http://wiki.inkscape.org/wiki/index.php/Save_as_vs_export>

Other related reports:
Bug #429529 “Opened bitmap images get overwritten with svg on save without warning” (fixed)
Bug #669267 “Saving file in PNG format creates incorrect file.” (remove PNG as 'Save' file format)

jazzynico (jazzynico)
tags: added: importing saving
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Ubuntu 10.10, Inkscape 0.48.

The most confusing thing is that the PNG is not really opened (Inkscape is not a bitmap editor), but imported. IMHO, the created document should, when a PNG is *opened* directly, use the bitmap size and have a standard "New document.svg" name. Thus it would be saved as SVG by default, and not as PNG.

Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
pRototype (regeir) wrote :

HI.

In the last beta versions, the bug have being replaced by an error message that prevents accidental overwrites.

However, in Inkscape 0.48+devel r10115 the bug is introduced once again. So I had to download a png image over again because the file on disc was destroyed.

I'm just very glad this file was rcently downloaded. If not, all work would have being wasted.

The warning message was a god way to prevent this to happens.

Revision history for this message
pRototype (regeir) wrote :

Update:

Inkscape 0.48+devel r10669

I just tested this again by open a png image directly in Inkscape. Then I drawed some figures and I hit Ctrl+S. Original png file is overwrited. It's a grim chance that I one day will lost some work because of this.

It seems to be a problem with PNG images only. for jpg's I got an errormsg when trying to save.

Thanks

Revision history for this message
pRototype (regeir) wrote :

Hope it's ok to bump some at this bug. After all it's almost three years since first reported.

Working with version 0.48+devel r12217 several times during a week. The bug is still present. This day I just lost a source image file because Inkscape did "export to PNG and overwrite the original file, when it should have asked for a filename to save as", wich resulted about an hour and a half wasted.

In the mentioned version of Inkscape, If closing Inkscape before saving, and if user choose to save he file, there will be a message that tell the user to save the file in svg format, but what actually happens is that the imported PNG file is overwritten and corrupted.
That is a bad thing, you have to know about this bug to avoid data loss!

Is there any workaround makin my png files safe from being overwritten by Inkscape, other than make them write protected?

That said - most of the time I'm aware of the danger of accidentally loss of png files, so having this kind of accident is fortunately a rare event. The true is, it's a bug that I can live with, but I would like to see it busted.

Revision history for this message
aoeuaoeuaoeu (thefizzynator) wrote :

Bump. It's still here.

Revision history for this message
aoeuaoeuaoeu (thefizzynator) wrote :

I use Windows 10 and a much newer version of Inkscape. The bug is still not fixed. This is detrimental to my workflow, because sometimes I open a template file and accidentally overwrite on that template file and lose the template file forever.

Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

Testing in 0.92.4, Windows 10:

Opening a PNG file and clicking "Embed" on the dialog opens it in Inkscape. A warning message is displayed on stdout: ** (org.inkscape.Inkscape:3996): WARNING **: 17:57:20.384: Unable to find output module to handle file: .../path/to/file.png. Editing the canvas and saving the file overrides it.

In Inkscape 1.1-dev (c990a67, 2020-04-09):

The warning message is made an error message when attempting to save. After closing the error message, the "Save as" dialog is displayed.

Closing as "Not reproducible". Please reopen on http://inkscape.org/report if the problem occurs again.

Closed by: https://gitlab.com/jhofinger

Changed in inkscape:
status: Confirmed → Invalid
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.