Inkscape.org
Beyond the Basics image xlink:href not working in headless
  1. #1
    hanso hanso @hanso

    Hi, I am trying to convert an SVG file with an image inside that is accessing an image from the web:

     

    <image
       xlink:href="https://images.unsplash.com/photo-1550522667-09c9bdb293a1?q=80=1931=format=crop=rb-4.0.3=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
       width="1085.4637"
       height="auto"
       preserveAspectRatio="xMinYMin"
       id="image995"
       x="227.70909"
       y="141.85721" />

     

    When I run it on my GUI machine, everything works and the image is exported as PNG.

    However, when I run it inside docker, I get these errors from Inkscape:

    inkscape ./test.svg --export-filename=test.png
    
    ** (inkscape:1796): WARNING **: 09:13:59.197: Failed to wrap object of type 'PangoFT2FontMap'. Hint: this error is commonly caused by failing to call a library init() function.
    
    ** (inkscape:1796): WARNING **: 09:13:59.247: Failed to wrap object of type 'GtkRecentManager'. Hint: this error is commonly caused by failing to call a library init() function.
    
    ** (inkscape:1796): WARNING **: 09:13:59.247: URI::getContents failed for 'https://images.unsplash.com/photo-1550522667-09c9bdb293a1?q=80=1931=format=crop=rb-4.0.3=M3wxMjA3fDB'

     

    Does somebody know a way to resolve this?

  2. #2
    inklinea inklinea @inklinea⛰️

    The url appears to be truncated in the WARNING message:

    https://images.unsplash.com/photo-1550522667-09c9bdb293a1?q=80=1931=format=crop=rb-4.0.3=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D

    vs

    https://images.unsplash.com/photo-1550522667-09c9bdb293a1?q=80=1931=format=crop=rb-4.0.3=M3wxMjA3fDB

    Try a test with a much shorter url - possibly without special characters to start with.

Inkscape Inkscape.org Inkscape Forum Beyond the Basics image xlink:href not working in headless