using convert with find in script
Posted: 2013-03-15T09:33:14-07:00
I have a simple script set up to convert everything in a folder up to 2 days oldto jpg, remove the transpanency of any files, and move it to another folder. I am getting an error that I have spent days searching for an answer to. If I get rid of the find command, it seems to work great. I am running Ubuntu 12.04 with imagemagick version imagemagick 8:6.6.9.7-5ubuntu3.2. Below are the 2 script versions, the error, and convert -list configure output. Anything that can be done to fix this?
Error
With find
Without find
convert -list configure
Error
Code: Select all
convert: unable to open image `/home/scott/test/%[filename:original].JPG': @ error/blob.c/OpenBlob/2587.
convert: missing an image filename `/home/scott/Pictures/201902.jpg' @ error/convert.c/ConvertImageCommand/3011.
convert: unable to open image `/home/scott/test/%[filename:original]_L.JPG': @ error/blob.c/OpenBlob/2587.
convert: missing an image filename `/home/scott/Pictures/201902.jpg' @ error/convert.c/ConvertImageCommand/3011.
Code: Select all
find /home/scott/Pictures/* -mtime -2 | xargs convert -set filename:original %t -background white +matte -thumbnail 400x400 /home/scott/test/%[filename:original].JPG
find /home/scott/Pictures/* -mtime -2 | xargs convert -set filename:original %t -background white +matte -thumbnail 160x160 /home/scott/test/%[filename:original]_L.JPG
Code: Select all
convert /home/scott/Pictures/* -set filename:original %t -background white +matte -thumbnail 400x400 /home/scott/test/%[filename:original].JPG
convert /home/scott/Pictures/* -set filename:original %t -background white +matte -thumbnail 160x160 /home/scott/test/%[filename:original]_L.JPG
Code: Select all
Path: /usr/share/ImageMagick-6.6.9/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/lqr-1 -fopenmp -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wall -pthread
CODER_PATH /usr/lib/ImageMagick-6.6.9/modules-Q16/coders
CONFIGURE ./configure '--prefix=/usr' '--sysconfdir=/etc' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--with-modules' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts' '--with-magick-plus-plus' '--with-djvu' '--enable-shared' '--without-dps' '--without-fpx' '--with-perl-options=INSTALLDIRS=vendor' '--x-includes=/usr/include/X11' '--x-libraries=/usr/lib/X11' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security'
CONFIGURE_PATH /etc/ImageMagick/
COPYRIGHT Copyright (C) 1999-2011 ImageMagick Studio LLC
CPPFLAGS -I/usr/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr openexr png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fpx=no --with-gslib=no --with-fontpath= --with-gs-font-dir=/usr/share/fonts/type1/gsfonts --with-perl=no
DOCUMENTATION_PATH /usr/share/doc/ImageMagick-6.6.9/
EXEC-PREFIX /usr
EXECUTABLE_PATH /usr/bin
FEATURES OpenMP
FILTER_PATH /usr/lib/ImageMagick-6.6.9/modules-Q16/filters
HOST x86_64-unknown-linux-gnu
LDFLAGS -L/usr/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/X11
LIB_VERSION 0x669
LIB_VERSION_NUMBER 6,6,9,7
LIBRARY_PATH /usr/lib/ImageMagick-6.6.9
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljpeg -llqr-1 -lglib-2.0 -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /usr
QuantumDepth 16
RELEASE_DATE 2012-08-17
SHARE_PATH /usr/share/ImageMagick-6.6.9
SVN_REVISION 4345
TARGET_CPU x86_64
TARGET_OS linux-gnu
TARGET_VENDOR unknown
VERSION 6.6.9
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick