Execute Command and ImageMagick

Post Reply
numnational
Member
Posts: 36
Joined: Tue Sep 30, 2014 3:28 pm

Execute Command and ImageMagick

Post by numnational » Fri Sep 06, 2019 3:41 pm

Hi all, sorry i'm starting with Execute Command and ImageMagick.

Here is my request.

I have 2 jpg file, 1 file for the Left on file for the Right (R & L). I want to have only one jpg file with the 2 pages, a montage of them.

I use ImageMagick on my local computer with this command on the Terminal and it work like i want : montage -geometry +0,1 '*.jpg' FinalMontage.jpg

See my example here :
https://www.dropbox.com/s/fsdhlmr0u5ek3 ... 1.png?dl=0


When i try to do this on the Switch server it doesn't work...

Here is my argument on the Execute command tools :

Execution mode : Concurent
Command or path : D:/Program Files/ImageMagick-7.0.8-Q16/magick.exe
Arguments : montage -geometry +0,1 "%1" "%2"
Output : File at pat
Copy input job : No
Output extension : Automatic
Fail if exit code is : Disregard exit code

Dont understand how i must change to work to have my final montage.

ImageMagick is correctly installed beacause i make another tools just to test and it work : convert -resize 5% "%1" "%2"

If you have a idea... Thanks.

jan_suhr
Advanced member
Posts: 266
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Execute Command and ImageMagick

Post by jan_suhr » Fri Sep 06, 2019 7:23 pm

You probably have to create a .BAT-file to run that in imageMagick.
Then you tell Execute Command to run that .BAT-file.

You can use my app "Execute Command Friend" to easily create the .BAT-file and use Switch variables in a very easy way.

https://www.enfocus.com/en/appstore/pro ... and-friend
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

numnational
Member
Posts: 36
Joined: Tue Sep 30, 2014 3:28 pm

Re: Execute Command and ImageMagick

Post by numnational » Wed Sep 11, 2019 5:07 pm

Thanks for your answer Jan, but i'm not enought ok with script or .bat file... don't understand the rule to crate my job... :roll:

Arthur
Member
Posts: 93
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: Execute Command and ImageMagick

Post by Arthur » Wed Sep 11, 2019 6:09 pm

Try to modify your arguments for %1 & %2 with fixed paths and switch arguments if needs be.

jan_suhr
Advanced member
Posts: 266
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Execute Command and ImageMagick

Post by jan_suhr » Wed Sep 11, 2019 9:28 pm

Your .BAT could be something like this. I haven't tried it myself but it gives a clue on what you should try.

Code: Select all

set inputfile=%1
set outputfile=%2
magick.exe montage -geometry +0,1 %inputfile %outputfile
You could try the .BAT-file with CMD.EXE and change the file variables to real paths and test if it will run.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

numnational
Member
Posts: 36
Joined: Tue Sep 30, 2014 3:28 pm

Re: Execute Command and ImageMagick

Post by numnational » Fri Oct 04, 2019 3:31 pm

Hi here is my final command, working perfectly thanks to Enfocus Support.


montage -geometry +0,1 "%1\[Job.NestedName:Index='2',After=' ']" "%1\[Job.NestedName:Index='3',After=' ']" "%2"

ChritianK
Member
Posts: 39
Joined: Wed Nov 29, 2017 10:57 am

Re: Execute Command and ImageMagick

Post by ChritianK » Fri Nov 15, 2019 12:13 pm

Have a similar issue with montage and to made contact sheet with several images :

This command I test in a .bat file works successfully :
"C:\Program Files\ImageMagick\magick.exe" montage -units PixelsPerInch "path\TEST\*.jpg" -tile 3x2 -geometry 827x1772+0+0 -density 300 "path\TEST\result\contact_sheet.jpg"

- Made a flow with Assemble Job in order to have a folder with all my images in it to made the contact sheet.

Then I try this Execute command :
Type Execute command
Description
Execution mode Serialized
Command or path C:/Program Files/ImageMagick/magick.exe
Arguments montage "%1"-units PixelsPerInch -tile 3x2 -geometry 827x1772+0+0 -density 300 "%2"
Output Result in folder
Copy input job Yes
Fail if exit code is Nonzero
Fail if stdout contains
Fail if stderr contains

But it failed, have this :

"2019-11-15 11:56:00","error","Execute command","CONTACT_SHEET","contact sheet","07MXT","planche","Job ''_07MXT_planche'' was moved from folder ''C:/Users/Administrateur/AppData/Roaming/Enfocus/Switch Server/backing/CONTACT_SHEET/automanaged/Folder 51'' to the problem jobs folder. Reason: see previous log message(s)"
"2019-11-15 11:56:00","error","Execute command","CONTACT_SHEET","contact sheet","07MXT","planche","Job failed because outcode is nonzero, outcode = [1]"
"2019-11-15 11:56:00","debug","Execute command","CONTACT_SHEET","contact sheet","07MXT","planche","stderr: montage: UnableToOpenConfigureFile `magic.xml'' @ warning/configure.c/GetConfigureOptions/714.; montage: UnableToOpenBlob ''C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\12\planche'': Permission denied @ error/blob.c/OpenBlob/3489.; montage: UnableToOpenConfigureFile `delegates.xml'' @ warning/configure.c/GetConfigureOptions/714.; montage: UnableToOpenBlob ''C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\12\planche'': Permission denied @ error/blob.c/OpenBlob/3489.; montage: NoDecodeDelegateForThisImageFormat `'' @ error/constitute.c/ReadImage/556.; montage: MissingAnImageFilename `C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\10\ExecuteComandResult\planche.jpg'' @ error/montage.c/MontageImageCommand/1777. »

It seem permission denied issue or is there another problem I didn't see ?

Thx in advance if anybody have ideas :-)

jan_suhr
Advanced member
Posts: 266
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Execute Command and ImageMagick

Post by jan_suhr » Fri Nov 15, 2019 12:47 pm

Have you tried this:

Code: Select all

Arguments montage -units PixelsPerInch "%1" -tile 3x2 -geometry 827x1772+0+0 -density 300 "%2"
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

ChritianK
Member
Posts: 39
Joined: Wed Nov 29, 2017 10:57 am

Re: Execute Command and ImageMagick

Post by ChritianK » Fri Nov 15, 2019 2:13 pm

Thanks for answering, I try it yes

Code: Select all

montage -units PixelsPerInch "%1" -tile 3x2 -geometry 827x1772+0+0 -density 300 "%2"
but have the same error....

stderr: montage: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/714.; montage: UnableToOpenBlob 'C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\15\planche': Permission denied @ error/blob.c/OpenBlob/3489.; montage: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/714.; montage: UnableToOpenBlob 'C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\15\planche': Permission denied @ error/blob.c/OpenBlob/3489.; montage: NoDecodeDelegateForThisImageFormat `' @ error/constitute.c/ReadImage/556.; montage: MissingAnImageFilename `C:\Users\Administrateur\AppData\Roaming\Enfocus\Switch Server\temp\169\ScriptElement\696\13\ExecuteComandResult\planche.jpg' @ error/montage.c/MontageImageCommand/1777.

ChritianK
Member
Posts: 39
Joined: Wed Nov 29, 2017 10:57 am

Re: Execute Command and ImageMagick

Post by ChritianK » Mon Nov 18, 2019 3:55 pm

Find solution with help from support, that give me the way to understand what's wrong ! 8-)

Post Reply