Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to convert SVG to PNG asks for potrace #250

Open
Moini opened this issue Jun 8, 2023 · 2 comments
Open

Trying to convert SVG to PNG asks for potrace #250

Moini opened this issue Jun 8, 2023 · 2 comments

Comments

@Moini
Copy link

Moini commented Jun 8, 2023

ImageMagick version

6.9.11-60 Q16 x86_64 2021-01-25

Operating system

Linux

Operating system, version and so on

Linux Mint 21.1 Vera

Description

I'm using a small script to convert files of different file types to thumbnails.

It has stopped working properly after updating my Linux Mint version. After fixing an issue with find, which now needs a different order of commands, I'm now stuck on an issue with convert, which is for some weird reason wanting to use potrace to convert an SVG to an PNG.

This might totally be a Linux Mint default settings bug, too. I have Inkscape installed (1.2.2), and rsvg, too.

Steps to Reproduce

for f in $(find -maxdepth 2 -printf '%P\n' -iname '*.jpg' -o -iname '*.eps' -o -iname '*.png' -o -iname '*.svg' | grep -v '/thumbnails/')
do
  if [ ! -f ./thumbnails/$f.png ]
  then
    echo "Creating thumbnail for $f"
    convert $f -background white -alpha remove -thumbnail 220x180\> - | convert - -gravity center -background "rgb(200,200,200)" -extent 240x200 -alpha remove ./thumbnails/$f.png
  fi
done

returns this for any SVG file (works for pngs, jpgs):

Creating thumbnail for 2023/mini-poster_kielux_2023_portrait.svg
convert-im6.q16: delegate failed `'potrace' --svg --output '%o' '%i'' @ error/delegate.c/InvokeDelegate/1966.
convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/575.
convert-im6.q16: no images defined `./thumbnails/2023/mini-poster_kielux_2023_portrait.svg.png' @ error/convert.c/ConvertImageCommand/3229.

Images

No response

@urban-warrior
Copy link
Member

Type convert -list format | grep PNG. Does the PNG format have a mode of rw-? If not, your ImageMagick build does not include PNG support so ImageMagick defaults to the input file type, SVG. When writing SVG, it leverages potrace to generate a SVG representation of the image pixels.

@Moini
Copy link
Author

Moini commented Jul 15, 2023

Thanks, @urban-warrior - but that's not the reason:

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants