mogrify -clone error help
-
- Posts: 5
- Joined: 2018-01-31T16:15:11-07:00
- Authentication code: 1152
mogrify -clone error help
Hi all,
(Running windows 10, cmd line, Win32 dynamic at 16 bits-per-pixel component, ImageMagick-7.0.7-22-Q16-x86-dll.exe)
The following code works but I'm trying (with little success) to run it through multiple files.
magick "filepath.jpg"^
( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 )^
( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 )^
-delete 0 -flatten output.jpg
Research suggests that mogrify doesn't work with -clone? Apparently a windows batch for loop is my best bet but I have little experience and would greatly appreciate any suggestions or guidance?
Cheers!
(Running windows 10, cmd line, Win32 dynamic at 16 bits-per-pixel component, ImageMagick-7.0.7-22-Q16-x86-dll.exe)
The following code works but I'm trying (with little success) to run it through multiple files.
magick "filepath.jpg"^
( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 )^
( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 )^
-delete 0 -flatten output.jpg
Research suggests that mogrify doesn't work with -clone? Apparently a windows batch for loop is my best bet but I have little experience and would greatly appreciate any suggestions or guidance?
Cheers!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: mogrify -clone error help
I do not think you can use mogrify with parenthesis and clones. You will likely have to write a script loop over each of the images you want to process.
-
- Posts: 5
- Joined: 2018-01-31T16:15:11-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: mogrify -clone error help
What's the problem? As Fred says, put it in a loop, eg in a BAT script:
Code: Select all
for %%F in (*.jpg) do magick ^
"%%F" ^
( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 ) ^
( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 ) ^
-delete 0 -flatten "newdir\%%F"
snibgo's IM pages: im.snibgo.com
-
- Posts: 5
- Joined: 2018-01-31T16:15:11-07:00
- Authentication code: 1152
Re: mogrify -clone error help
Hi
Commands don't seem to be executing now? I'm sure that I'm referencing the correct path. Changed the file extension and still no luck.
magick: unable to open image 'C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff(': No such file or directory @ error/blob.c/OpenBlob/3335.
magick: unable to open module file 'C:\Program Files\ImageMagick-7.0.7-Q16\modules\coders\IM_MOD_RL_TIFF(_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/675.
magick: no decode delegate for this image format `TIFF(' @ error/constitute.c/ReadImage/509.
I've uninstalled and reinstalled and rebooted without success.
Thanks.
Commands don't seem to be executing now? I'm sure that I'm referencing the correct path. Changed the file extension and still no luck.
magick: unable to open image 'C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff(': No such file or directory @ error/blob.c/OpenBlob/3335.
magick: unable to open module file 'C:\Program Files\ImageMagick-7.0.7-Q16\modules\coders\IM_MOD_RL_TIFF(_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/675.
magick: no decode delegate for this image format `TIFF(' @ error/constitute.c/ReadImage/509.
I've uninstalled and reinstalled and rebooted without success.
Thanks.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: mogrify -clone error help
Is libtif installed. That is does
magick -version
list tiff in the Delegates section
What was your exact command where it failed?
magick -version
list tiff in the Delegates section
What was your exact command where it failed?
-
- Posts: 5
- Joined: 2018-01-31T16:15:11-07:00
- Authentication code: 1152
Re: mogrify -clone error help
yes tiff is listed in the delegates:
Version: ImageMagick 7.0.7-22 Q16 x86 2018-01-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib
-----------------------------------------------------------------------------
The command is much the same as above (tried with both jpg and tiff formats): my exact command in cmd line (which executed perfectly yesterday):
C:\Users\Travel\Desktop\ocr_certs\Cert>magick "C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff"^
More? ( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 )^
More? ( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 )^
More? -delete 0 -flatten output.tiff
The response is:
magick: unable to open image 'C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff(': No such file or directory @ error/blob.c/OpenBlob/3335.
magick: unable to open module file 'C:\Program Files\ImageMagick-7.0.7-Q16\modules\coders\IM_MOD_RL_TIFF(_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/675.
magick: no decode delegate for this image format `TIFF(' @ error/constitute.c/ReadImage/509.
Thanks again guys appreciate the responses.
Version: ImageMagick 7.0.7-22 Q16 x86 2018-01-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib
-----------------------------------------------------------------------------
The command is much the same as above (tried with both jpg and tiff formats): my exact command in cmd line (which executed perfectly yesterday):
C:\Users\Travel\Desktop\ocr_certs\Cert>magick "C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff"^
More? ( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 )^
More? ( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 )^
More? -delete 0 -flatten output.tiff
The response is:
magick: unable to open image 'C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff(': No such file or directory @ error/blob.c/OpenBlob/3335.
magick: unable to open module file 'C:\Program Files\ImageMagick-7.0.7-Q16\modules\coders\IM_MOD_RL_TIFF(_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/675.
magick: no decode delegate for this image format `TIFF(' @ error/constitute.c/ReadImage/509.
Thanks again guys appreciate the responses.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: mogrify -clone error help
What is "More?" in your command? You need a space before and after parentheses. So the problem is you have )^ and need ) ^.
Try
Try
Code: Select all
C:\Users\Travel\Desktop\ocr_certs\Cert>magick "C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff" ^
( -clone 0 -crop 485x181+847+969 -resize 485x181! -repage 490x362+0+0 ) ^
( -clone 0 -crop 485x111x2307+1574 -resize 485x111! -repage 490x362+0+181 ) ^
-delete 0 -flatten output.tiff
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: mogrify -clone error help
You should always read error messages carefully. IM told you it was trying to open a file that had "(" at the end of its name.howtaebatch wrote:magick: unable to open image 'C:\Users\Travel\Desktop\ocr_certs\Cert\Mnth1.tiff('
The command I showed you had a space before each line-continuation "^" at the end of each line, and also had spaces at the start of each line. You removed all these spaces, and that caused the problem.
snibgo's IM pages: im.snibgo.com
-
- Posts: 5
- Joined: 2018-01-31T16:15:11-07:00
- Authentication code: 1152
Re: mogrify -clone error help
Got the command working; Batch file is working too. Thanks for the help guys! Appreciated.