Hi I'm trying to write a Catalina mac Automator script that will convert .WEBP files into .JPG files.

The shell code in Automator I'm using is

for img in "$@"; do
 /usr/local/bin/convert "$img" -background white -flatten "$filename.jpg"

This script above converts to jpg but gives the following error:

The action “Run Shell Script” encountered an error:

“convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562.

convert: no images defined `/Users/Testuser/My Documents/Apple Directory.jpg' @ error/convert.c/ConvertImageCommand/3273.”

Can any expert here tell me what's wrong with the code? I'm just dropping the image files on the app icon. Thanks!

  • Does it work if you just run convert with one of the input files directly in Terminal? – nohillside Dec 10 '19 at 13:07
  • Yes it does work.. something to do with file handling? – sd100 Dec 10 '19 at 13:07
  • It looks like one of the files isn't in a format convert understands. – nohillside Dec 10 '19 at 13:11
  • It’s a .WEBP file and I have installed webp libraries etc using brew – sd100 Dec 10 '19 at 13:12
  • Are you sure that this is the file convert is trying to read? – nohillside Dec 10 '19 at 13:15

You must log in to answer this question.

Browse other questions tagged .