title: ImageMagick convert for loop
body: <p>I would like to iterate this code over a directory of files:</p>
  
  <pre><code>convert Film_Crew.jpg -resize 1920x1080 -size 1920x1080 xc:black +swap -gravity center -composite Film_Crew_resize.jpg
  </code></pre>
  
  <p>Images in my directory:</p>
  
  <p>Film_Crew.jpg</p>
  
  <p>Film_Crew copy.jpg</p>
  
  <p>Film_Crew copy 2.jpg</p>
  
  <p>Film_Crew copy 3.jpg</p>
  
  <p>Film_Crew copy 4.jpg</p>
  
  <p>Film_Crew copy 5.jpg</p>
  
  <p>Film_Crew copy 6.jpg</p>
  
  <p>I tried to use this code because it worked for me last time I tried, but it isn't working now.</p>
  
  <pre><code>for i in *.*; do convert $i -auto-orient -resize 1920x1080 -size 1920x1080 xc:black +swap -gravity center -composite "new/${i%.*}.jpg";done
  </code></pre>
  
  <p>I am on a Mac working in Terminal. The error I get is this:</p>
  
  <p>convert: unable to open image <code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>copy': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>2.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image</code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined <code>new/Film_Crew copy 2.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image</code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format <code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image</code>copy': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format <code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image</code>3.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image <code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined</code>new/Film_Crew copy 3.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image <code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>copy': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>4.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image</code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined <code>new/Film_Crew copy 4.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image</code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format <code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image</code>copy': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format <code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image</code>5.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image <code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined</code>new/Film_Crew copy 5.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image <code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>copy': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format</code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image <code>6.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image</code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined <code>new/Film_Crew copy 6.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image</code>Film_Crew': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no decode delegate for this image format <code>' @ error/constitute.c/ReadImage/504.
  convert: unable to open image</code>copy.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
  convert: no such image <code>black' @ error/mogrify.c/MogrifyImageList/8770.
  convert: no images defined</code>new/Film_Crew copy.jpg' @ error/convert.c/ConvertImageCommand/3258.
  convert: unable to open image `new/Film_Crew.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.</p>