Option to not auto-replace broken links
Summary:
When you open an svg, if Inkscape doesn't find a linked image, it will automatically look for it in other folders and if it finds an image with the same name, it will use it instead of leaving the link as broken.
A pop-up warns you when this happens but the phrasing is not extremely clear and depending on the job you're doing, this feature may be more dangerous than useful (at least it is for me and my colleagues).
Steps to reproduce:
- Create 2 bitmap images with the same name but different contents and put them in this folder structure:
folder1
├ image.jpg
└ folder2
└ image.jpg
- open Inkscape
- drag one image (can be either) and chose "Link" when prompted
- save your svg in the same folder as the image you linked
- close Inkscape
- delete that same bitmap image
- re-open the svg: Inkscape will replace the deleted image by the other one with the same name and show a pop-up saying: "Broken links have been changed to point to existing files."
Note: This may not happen on Mac, as told by Paddy_CAD here.
I use Linux and that's where it happens. I don't know about Windows yet.
Suggestions
Quick "to the point" solution:
In Edit > Preferences > Imported Images, there could be a checkbox saying:
More complete solution:
To address several issues regarding handling of broken links (including #2395), a solution would be, instead of auto-replacing right away without giving the user any choice, to show a dialog containing a selectable list of all the broken images and some options to handle them:
In this mockup, the first broken link just got handled by the user by browsing manually, thus giving the green check icon.
If you hit "Apply" without doing anything you would get the usual "Linked Image not found" dummy image in place of broken images:
Version info
This behavior was there at least since Inkscape 0.92 and up to 1.1.1 on Linux (Debian)
My debug info anyway:
Inkscape 1.1.1 (3bf5ae0, 2021-09-20)
GLib version: 2.64.6
GTK version: 3.24.20
glibmm version: 2.64.2
gtkmm version: 3.24.2
libxml2 version: 2.9.10
libxslt version: 1.1.34
Cairo version: 1.16.0
Pango version: 1.44.7
HarfBuzz version: 2.6.4
Poppler version: 0.86.1
OS version: Debian GNU/Linux 11 (bullseye)