Auto generate renditions .jpg, .psd 'unable to open image' error
Posted: 2016-11-27T11:23:10-07:00
Hello!
I am trying to write a script to automatically generate renditions for .tif, .jpg and .psd files.
(I'm on ImageMagick 7.0.2-1 Q16 x64 2016-06-23)
Right now, my script says:
@echo off
set ORIGINAL_FOLDER=.\original-assets
set RENDITION_FOLDER=.\renditions
for /f %%A in ('dir /B %ORIGINAL_FOLDER%') DO (
echo Generating Renditions for %%A...
::* Generate High Res JPEG (300dpi) CMYK
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 300 -colorspace CMYK -gravity center -adjoin %RENDITION_FOLDER%/300CMYK/%%A_300CMYK.jpg
::* Generate High Res JPEG (300dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 300 -colorspace sRGB -gravity center %RENDITION_FOLDER%/300RGB/%%A_300RGB.jpg
::* Generate Low res jpeg (150 dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -density 150 -define jpeg -colorspace sRGB -gravity center %RENDITION_FOLDER%/150/%%A_150.jpg
::* Generate Low res jpeg (72 dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 72 -colorspace sRGB -gravity center %RENDITION_FOLDER%/72/%%A_72.jpg
The script runs successfully on the .tif file, but I get the following error for the .jpg and .psd:
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300CMYK/Collect_300CMYK.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300RGB/Collect_300RGB.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/150/Collect_150.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/72/Collect_72.jpg' @ error/convert.c/ConvertImageCommand/3235.
Generating Renditions for Polichrome_...
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300CMYK/Polichrome__300CMYK.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300RGB/Polichrome__300RGB.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/150/Polichrome__150.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/72/Polichrome__72.jpg' @ error/convert.c/ConvertImageCommand/3235.
Why did it work for the .tif but not the others? What do I need to add to my script to get it to work? What does the error mean?
I am completely new to IM and have zero coding experience.
Any help is much appreciated!!
I am trying to write a script to automatically generate renditions for .tif, .jpg and .psd files.
(I'm on ImageMagick 7.0.2-1 Q16 x64 2016-06-23)
Right now, my script says:
@echo off
set ORIGINAL_FOLDER=.\original-assets
set RENDITION_FOLDER=.\renditions
for /f %%A in ('dir /B %ORIGINAL_FOLDER%') DO (
echo Generating Renditions for %%A...
::* Generate High Res JPEG (300dpi) CMYK
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 300 -colorspace CMYK -gravity center -adjoin %RENDITION_FOLDER%/300CMYK/%%A_300CMYK.jpg
::* Generate High Res JPEG (300dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 300 -colorspace sRGB -gravity center %RENDITION_FOLDER%/300RGB/%%A_300RGB.jpg
::* Generate Low res jpeg (150 dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -density 150 -define jpeg -colorspace sRGB -gravity center %RENDITION_FOLDER%/150/%%A_150.jpg
::* Generate Low res jpeg (72 dpi) RGB
convert %ORIGINAL_FOLDER%/%%A -define jpeg -density 72 -colorspace sRGB -gravity center %RENDITION_FOLDER%/72/%%A_72.jpg
The script runs successfully on the .tif file, but I get the following error for the .jpg and .psd:
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300CMYK/Collect_300CMYK.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300RGB/Collect_300RGB.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/150/Collect_150.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Collect': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/72/Collect_72.jpg' @ error/convert.c/ConvertImageCommand/3235.
Generating Renditions for Polichrome_...
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300CMYK/Polichrome__300CMYK.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/300RGB/Polichrome__300RGB.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/150/Polichrome__150.jpg' @ error/convert.c/ConvertImageCommand/3235.
convert: unable to open image '.\original-assets/Polichrome_': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no images defined `.\renditions/72/Polichrome__72.jpg' @ error/convert.c/ConvertImageCommand/3235.
Why did it work for the .tif but not the others? What do I need to add to my script to get it to work? What does the error mean?
I am completely new to IM and have zero coding experience.
Any help is much appreciated!!