Inkscape.org
Beyond the Basics Disable auto-searching of missing image
  1. #1
    Chameleon Scales Chameleon Scales @Chameleon_Scales
    *

    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 considering the link broken.

    Sure there is a warning pop-up when this happens but in my job this feature is useless and dangerous if you don't pay enough attention. I didn't find an option to disable it in the prefs but maybe I missed it. Otherwise is there a chance that an option with a checkbox would be implemented?

  2. #2
    Paddy_CAD Paddy_CAD @Paddy_CAD

    If you use relative file paths, and you move the destination file, then Inkscape will link to files at the new relative location. This is intentional as it lets you move or copy a project (folders, files and linked files) across directory structures without breaking everything.

    Under [Inkscape Preferences > Imported Images] you should deselect the checkbox [Store absolute file path]. If this is selected, and you move the destination file, then Inkscape will look back to the original absolute location when it can't find a matching filename at the relative location.

    Personally I find that moving files nearly always breaks my links and I have to update the file paths manually using the XML Editor [shift+ctrl+x] [xlink:href] or Image Properties [right_click > Image Properties...] [URL:].

  3. #3
    Chameleon Scales Chameleon Scales @Chameleon_Scales
    *

    Your solution doesn't seem to work, or maybe you misunderstood my problem. This is not a matter of using absolute or relative paths. It's about when inkscape doesn't find a file that is not where it should be and searches through the entire folder tree for a file with the same basename.

    For example, say I have this structure :

    folder1

      ├ image.jpg

      └ folder2

        ├ drawing.svg

        └ image.jpg

     

    Now say drawing.svg contains a link to the image contained in the same folder and I delete that image file.

    Next time I open drawing.svg, Inkscape will not find the image at the given path and will automatically go to the parent folder and start browsing the tree, find the other image and assume it's the one to link.

    This is a simplified example but in my job this can result in a whole bunch of svgs getting their images replaced by others from completely different project folders, which is dangerous because I may not notice it immediately.

    And this behavior doesn't change whether the "absolute path" option is checked or not (I just tried). In any case the relative path is always contained. If you remove it manually and leave only the absolute path, the image will be white (it will not even display the broken link sign for some reason).

  4. #4
    Paddy_CAD Paddy_CAD @Paddy_CAD

    I think I understood the problem but I can't reproduce it. To make sure, I duplicated your folder structure above. Looking at drawing.svg in a text editor shows me this.

        <image
           width="79.375"
           height="79.110417"
           preserveAspectRatio="none"
           xlink:href="folder2/image.png"
           id="image1395"
           x="65.330482"
           y="108.94479" />

    When I delete the file folder1/folder2/image.png Inkscape shows me "Linked Image Not Found", as expected. It does not substitute folder1/image.png for the missing file.

    Please check the image URL [right-click > Image Properties] before and after you delete the linked file and let us know what you find.

  5. #5
    Chameleon Scales Chameleon Scales @Chameleon_Scales

    The url in image properties changes as you'd expect it to after finding the other one.

    Don't you have a popup when you open the svg right after deleting the image saying "Broken links have been changed to point to existing files."?

    Note that you did not exactly replicate my folder tree because drawing.svg should be in folder2. Therefore the relative link shouldn't include "folder2/". However, the behavior is the same if drawing.svg is in folder1.

    What OS and and Inkscape version are you using? I'm using the 1.1.1 appimage on Debian. The same happens on Inkscape 1.0 installed from apt, as well as 0.92 on older Debian versions. Maybe on Mac or Windows it behaves differently?

  6. #6
    Paddy_CAD Paddy_CAD @Paddy_CAD

    I saw no message that broken links were repaired.

    You're right, I got the folder structure wrong so I changed it and saw the same result: "Linked Image Not Found". 

    Right now I'm working with Inkscape 1.1 on macOS. I'll test this on windows when I get the chance. Or maybe somebody else will chime in?

    I just came across a related forum post (https://inkscape.org/cs/forums/questions/broken-link-checker/). I also found a related feature request (https://gitlab.com/inkscape/inbox/-/issues/2395) but there's no indication that this was implemented. It seems that automatically resolving broken links is an undocumented feature that just doesn't work on a mac.

  7. #7
    Chameleon Scales Chameleon Scales @Chameleon_Scales

    Thanks, I didn't see those.

    The feature request is not really what I'm looking for, although it makes sense too.

    I guess I'll make one concerning my issue then.

  8. #8
    Chameleon Scales Chameleon Scales @Chameleon_Scales

    There:

    https://gitlab.com/inkscape/inbox/-/issues/5894

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Disable auto-searching of missing image