ImageMagick and Run Command issue with JPEG

Post Reply
User avatar
valaxedo
Newbie
Posts: 8
Joined: Mon Mar 14, 2011 4:40 pm

ImageMagick and Run Command issue with JPEG

Post by valaxedo »

Hello members!
I'm quite a newbie in these fields, and I'm looking for an explanation about an issue.
My goal is to append two jpeg images into one.

To do so, I installed the Run Command from AppStore using Zsh with the following command:

/opt/homebrew/Cellar/imagemagick/7.1.1-43/bin/magick %%[Job.Path]%/[Job.NestedName:Index="2",Space="trim"] %%/[Job.Path]%%/[Job.NestedName:Index="3",Space="trim"] -append result.jpg

Each time, I receive this error:
Command failed with exit code: "1", Error output: "magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/746. "

I tested the same function in the Terminal and it worked fine:
svc_masterbrowser@FLO-MAC-107036 ~ % magick /Users/svc_masterbrowser/Desktop/JUSTDANCE_Inlay_SWITCH_1.jpg /Users/svc_masterbrowser/Desktop/JUSTDANCE_Inlay_SWITCH_2.jpg -append TestAppend.jpg

I'm, then, pretty sure that my syntax is not good in Switch.
Would you be able to explain what?

Many thanks
Regards.
Axel
UBISOFT | Axel ROBERT | Senior Manager, Prepress & Quality
freddyp
Advanced member
Posts: 1109
Joined: Thu Feb 09, 2012 3:53 pm

Re: ImageMagick and Run Command issue with JPEG

Post by freddyp »

The paths of the input file and output file that you tested in Terminal did not contain spaces. The paths to the backing folders in Switch will, and I think that is your problem. Place quotes around the paths (because there are already double quotes, I would first try with single quotes):
'%%[Job...."trim"]'
User avatar
valaxedo
Newbie
Posts: 8
Joined: Mon Mar 14, 2011 4:40 pm

Re: ImageMagick and Run Command issue with JPEG

Post by valaxedo »

Hello Freddy!
Thank you for your answer.

I amended it but the result, still an error, is quite different now:
"Command failed with exit code: "1", error ouput: "magick: unable t oopen image. No such file or directory @ error/blob.c/OpenBlob/3596."

It's the same with a double quote. :-(

Best.
UBISOFT | Axel ROBERT | Senior Manager, Prepress & Quality
loicaigon
Advanced member
Posts: 560
Joined: Wed Jul 10, 2013 10:22 am

Re: ImageMagick and Run Command issue with JPEG

Post by loicaigon »

Hi

Have you looked at the log messages what is the command Switch exactly tries to execute?

Image

It's typically a good way to see if your command is well constructed and you can even copy/paste in a terminal to double test local vs Switch.
Loïc Aigon
Enfocus PitStop Manager
User avatar
valaxedo
Newbie
Posts: 8
Joined: Mon Mar 14, 2011 4:40 pm

Re: ImageMagick and Run Command issue with JPEG

Post by valaxedo »

Hello Loïc!
How are you?

Thank you for your input.
I already tested the cli magick cmd and it works fine.

But in Switch: Command failed with exit code: "1", Error output: "magick: unable to open image '%%/Users/svc_masterbrowser/Documents/Switch Email Template v2/IN_Magick/_000BG_000BG044%/JUSTDANCE_Inlay_SWITCH_1.jpg': No such file or directory @ error/blob.c/OpenBlob/3596. "

svc_masterbrowser@FLO-MAC-107036 ~ % magick /Users/svc_masterbrowser/Desktop/JUSTDANCE_Inlay_SWITCH_1.jpg /Users/svc_masterbrowser/Desktop/JUSTDANCE_Inlay_SWITCH_2.jpg -append TestAppend.jpg

Weird, no? What did I miss, so far?
Thanks!
UBISOFT | Axel ROBERT | Senior Manager, Prepress & Quality
loicaigon
Advanced member
Posts: 560
Joined: Wed Jul 10, 2013 10:22 am

Re: ImageMagick and Run Command issue with JPEG

Post by loicaigon »

Ok,

I could get it working somehow:

"/opt/homebrew/bin/magick" "[Job.Path]/[Job.NestedName:Index="2",Space="trim"]" "[Job.Path]/[Job.NestedName:Index="3",Space="trim"]" -append "%%OutputPath%%/appended.jpg"

When i say somehow, I mean I get the appended.jpg in th output folder. If you need more or different, you will have to dig it further.

Loic
Loïc Aigon
Enfocus PitStop Manager
User avatar
valaxedo
Newbie
Posts: 8
Joined: Mon Mar 14, 2011 4:40 pm

Re: ImageMagick and Run Command issue with JPEG

Post by valaxedo »

Hello Loïc.
Thank you for the suggestion!

But I'm still have an error in the Run Command:
"Command failed wtih exit code: "1", error output: "zsh"1: unmatched " "

Best.
UBISOFT | Axel ROBERT | Senior Manager, Prepress & Quality
loicaigon
Advanced member
Posts: 560
Joined: Wed Jul 10, 2013 10:22 am

Re: ImageMagick and Run Command issue with JPEG

Post by loicaigon »

On a Windows? Because sometimes you need to escape the quotes \"

Did you try using single quotes? Or you may need to contact the author of the script to get some insights?
Loïc Aigon
Enfocus PitStop Manager
User avatar
valaxedo
Newbie
Posts: 8
Joined: Mon Mar 14, 2011 4:40 pm

Re: ImageMagick and Run Command issue with JPEG

Post by valaxedo »

It's on Mac OS.
And I'm the script's owner, so far.
Even if I'm a newbie, for sure!
Anyhow, same result with just one quote.
But I found the issue.
I've missed two double quote in front and the end of the whole variable:
"/opt/homebrew/Cellar/imagemagick/7.1.1-43/bin/magick" "[Job.Path]/[Job.NestedName:Index="2",Space="trim"]" "[Job.Path]/[Job.NestedName:Index="3",Space="trim"]" -append "%%OutputPath%%/appended.jpg"

This one works perfectly.
Best.
Last edited by valaxedo on Mon Feb 10, 2025 2:47 pm, edited 1 time in total.
UBISOFT | Axel ROBERT | Senior Manager, Prepress & Quality
loicaigon
Advanced member
Posts: 560
Joined: Wed Jul 10, 2013 10:22 am

Re: ImageMagick and Run Command issue with JPEG

Post by loicaigon »

Did you update the bin location?

meaning
"/opt/homebrew/bin/magick"
to
"/opt/homebrew/Cellar/imagemagick/7.1.1-43/bin/magick"

I am running out of ideas :)
Loïc Aigon
Enfocus PitStop Manager
Post Reply