I have the two folders under the same level directory
folder1 and folder 2
now I try to convert all images in folder1 to folder2 and with same file name.
here is what i have now:
for f in folder1/*.jpg
do
convert $f -resize 80%X80% +profile "*" -quality 85 folder2/$f
done
and it throws the following message from each file it tried to convert:
convert: unable to open image `folder1/folder2/st-3474827-1.jpg’: No such file or directory @ blob.c/OpenBlob/2440.
and I know its directory problem but google for two days already still dont know how to fix it. Can you help me with this?
There’s two ways you could deal with it.
Use
mogrify:Use
basename:The former option is probably better, but the latter may be clearer.