ConvertX icon indicating copy to clipboard operation
ConvertX copied to clipboard

Conversion Error with SVG to PNG via ImageMagick

Open StrangeRanger opened this issue 9 months ago • 0 comments

Describe the bug

When trying to convert an SVG into a PNG via ImageMagick, I get a conversion error:

convertx  | jobId set to: 26
convertx  | stderr: magick: delegate failed `'rsvg-convert' --dpi-x %x --dpi-y %y -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1919.
convertx  | magick: unable to open file '/tmp/magick-G__M7MFUgIJuchSiSBAeNkf92hBMB2Q4': No such file or directory @ error/constitute.c/ReadImage/785.
convertx  | 
convertx  | Failed to convert ./data/uploads/1/26/logo-black.svg from svg to png using imagemagick. error: Error: Command failed: magick ./data/uploads/1/26/logo-black.svg ./data/output/1/26/logo-black.png
convertx  | magick: delegate failed `'rsvg-convert' --dpi-x %x --dpi-y %y -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1919.
convertx  | magick: unable to open file '/tmp/magick-G__M7MFUgIJuchSiSBAeNkf92hBMB2Q4': No such file or directory @ error/constitute.c/ReadImage/785.

What works with svg to png:

  • resvg
  • vips
  • graphicsmagick
  • inkscape
    • Though it does produce the following warnings:
    convertx  | ** (inkscape:114): WARNING **: 20:40:55.043: Failed to wrap object of type 'PangoFT2FontMap'. Hint: this error is commonly caused by failing to call a library init() function.
    convertx  | 
    convertx  | ** (inkscape:114): WARNING **: 20:40:56.592: Failed to wrap object of type 'GtkRecentManager'. Hint: this error is commonly caused by failing to call a library init() function.
    
  • ffmpeg
    • Though it does output a notice regarding a pattern thing, which I'm sure is fine:
    convertx  | [image2 @ 0xaaaadf69aac0] The specified filename './data/output/1/29/logo-black.png' does not contain an image sequence pattern or a pattern is invalid.
    convertx  | [image2 @ 0xaaaadf69aac0] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
    convertx  | [out#0/image2 @ 0xaaaadf66da50] video:2KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
    convertx  | frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=3.28x  
    

Here is the full Docker Compose log:

❯ docker compose up   
[+] Running 2/2
 ✔ Network convertx_default  Created                                                                                                                                                                                                   0.1s 
 ✔ Container convertx        Created                                                                                                                                                                                                   0.3s 
Attaching to convertx
convertx  | ConvertX v0.14.1
convertx  | 🦊 Elysia is running at http://localhost:3000
convertx  | Debian GNU/Linux 13 (trixie)
convertx  | resvg v0.45.1
convertx  | ImageMagick 7.1.1-43 Q16 aarch64 22550 https://imagemagick.org
convertx  | Bun v1.2.2
convertx  | libheif v1.19.8
convertx  | potrace 1.16. Copyright (C) 2001-2019 Peter Selinger.
convertx  | djxl v0.11.1 [NEON,NEON_WITHOUT_AES]
convertx  | vips-8.16.1
convertx  | ffmpeg version 7.1.1-1+b1 Copyright (c) 2000-2025 the FFmpeg developers
convertx  | pandoc 3.1.11.1
convertx  | GraphicsMagick 1.4 snapshot-20250331 Q16 http://www.GraphicsMagick.org/
convertx  | XeTeX 3.141592653-2.6-0.999996 (TeX Live 2025/dev/Debian)
convertx  | assimp Version 5.4 -debug -shared -st (GIT commit 0)
convertx  | ebook-convert (calibre 8.4.0)
convertx  | Inkscape 1.4 (e7c3feb100, 2024-10-09)
convertx  | jobId set to: 24
convertx  | Converted ./data/uploads/1/24/logo-black.svg from svg to png successfully using resvg. Done
convertx  | jobId set to: 25
convertx  | Converted ./data/uploads/1/25/logo-black.svg from svg to png successfully using vips. Done
convertx  | jobId set to: 26
convertx  | stderr: magick: delegate failed `'rsvg-convert' --dpi-x %x --dpi-y %y -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1919.
convertx  | magick: unable to open file '/tmp/magick-G__M7MFUgIJuchSiSBAeNkf92hBMB2Q4': No such file or directory @ error/constitute.c/ReadImage/785.
convertx  | 
convertx  | Failed to convert ./data/uploads/1/26/logo-black.svg from svg to png using imagemagick. error: Error: Command failed: magick ./data/uploads/1/26/logo-black.svg ./data/output/1/26/logo-black.png
convertx  | magick: delegate failed `'rsvg-convert' --dpi-x %x --dpi-y %y -o '%o' '%i'' @ error/delegate.c/InvokeDelegate/1919.
convertx  | magick: unable to open file '/tmp/magick-G__M7MFUgIJuchSiSBAeNkf92hBMB2Q4': No such file or directory @ error/constitute.c/ReadImage/785.
convertx  | 
convertx  | jobId set to: 27
convertx  | Converted ./data/uploads/1/27/logo-black.svg from svg to png successfully using graphicsmagick. Done
convertx  | jobId set to: 28
convertx  | stderr: 
convertx  | ** (inkscape:114): WARNING **: 20:40:55.043: Failed to wrap object of type 'PangoFT2FontMap'. Hint: this error is commonly caused by failing to call a library init() function.
convertx  | 
convertx  | ** (inkscape:114): WARNING **: 20:40:56.592: Failed to wrap object of type 'GtkRecentManager'. Hint: this error is commonly caused by failing to call a library init() function.
convertx  | 
convertx  | Converted ./data/uploads/1/28/logo-black.svg from svg to png successfully using inkscape. Done
convertx  | jobId set to: 29
convertx  | stderr: ffmpeg version 7.1.1-1+b1 Copyright (c) 2000-2025 the FFmpeg developers
convertx  |   built with gcc 14 (Debian 14.2.0-18)
convertx  |   configuration: --prefix=/usr --extra-version=1+b1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --disable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
convertx  |   libavutil      59. 39.100 / 59. 39.100
convertx  |   libavcodec     61. 19.101 / 61. 19.101
convertx  |   libavformat    61.  7.100 / 61.  7.100
convertx  |   libavdevice    61.  3.100 / 61.  3.100
convertx  |   libavfilter    10.  4.100 / 10.  4.100
convertx  |   libswscale      8.  3.100 /  8.  3.100
convertx  |   libswresample   5.  3.100 /  5.  3.100
convertx  |   libpostproc    58.  3.100 / 58.  3.100
convertx  | Input #0, svg_pipe, from './data/uploads/1/29/logo-black.svg':
convertx  |   Duration: N/A, bitrate: N/A
convertx  |   Stream #0:0: Video: svg (librsvg), bgra, 100x100, 25 fps, 25 tbr, 25 tbn
convertx  | Stream mapping:
convertx  |   Stream #0:0 -> #0:0 (svg (librsvg) -> png (native))
convertx  | Press [q] to stop, [?] for help
convertx  | Output #0, image2, to './data/output/1/29/logo-black.png':
convertx  |   Metadata:
convertx  |     encoder         : Lavf61.7.100
convertx  |   Stream #0:0: Video: png, rgba(pc, gbr/unknown/unknown, progressive), 100x100, q=2-31, 200 kb/s, 25 fps, 25 tbn
convertx  |       Metadata:
convertx  |         encoder         : Lavc61.19.101 png
convertx  | [image2 @ 0xaaaadf69aac0] The specified filename './data/output/1/29/logo-black.png' does not contain an image sequence pattern or a pattern is invalid.
convertx  | [image2 @ 0xaaaadf69aac0] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
convertx  | [out#0/image2 @ 0xaaaadf66da50] video:2KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
convertx  | frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=3.28x    
convertx  | 
convertx  | Converted ./data/uploads/1/29/logo-black.svg from svg to png successfully using ffmpeg. Done
convertx  | jobId set to: 30

To Reproduce Steps to reproduce the behavior:

  1. Upload an SVG file like the logo for Backrest.
  2. Select any of the specified PNG conversion methods, specifically ImageMagick.
  3. Click the "Convert" button.
  4. See failure.

Checklist:

  • [x] I am accessing ConvertX over HTTPS or have HTTP_ALLOWED=true

StrangeRanger avatar Jun 08 '25 20:06 StrangeRanger