Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalid argument for option '-resize' in shell script

I've coded the following script in shell that creates a folder in a directory, then moves all images to this directory and then converts it and puts to a folder before. if I do this process manually it works fine, but apparently there's a conflict between the "convert" command and my loop. the "big" folder is the one that will retain the images with its original sizes and then the "tabloid" folder will contain thumbnail-sized formats of the same images.

cd tabloid
mkdir big
mv * big
cd big
for i in 00 01 02 03 04 05 06 07 08 09 10 11
  do
    convert -resize 351×383 "$i.jpg" "../$i.jpg"
  done

it returns the following error:

convert.im6: invalid argument for option `-resize': 351×383 @  error/convert.c/ConvertImageCommand/2382.

I don't know what could be wrong with my script. apparently it's in the loop because if I do the process manually (converting image per image via terminal), it works fine.

like image 544
flpost Avatar asked Nov 07 '14 11:11

flpost


Video Answer


1 Answers

That's not an ASCII x (0x78) in your convert line that's × (MULTIPLICATION SIGN 0xd7).

like image 132
Etan Reisner Avatar answered Sep 27 '22 22:09

Etan Reisner