Page 1 of 1

Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T11:38:24-07:00
by elifafd
I try to mogrify psd files to jpg files over 300 subfolders in a master folder.

find albums -iname "*.psd" | mogrify -format jpg *.psd

I tried it with the above command but get the following error

mogrify: unable to open image `*.psd': File or folder do not exist.

Could someone please help me

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T11:44:30-07:00
by fmw42
you have to be in the same directory as all the images for mogrify or you have to provide a path argument to tell it what directory to process. So if you have files in different directories, then you will need to cp or mv them to some common directory.

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T11:48:21-07:00
by elifafd
That is no solution, i have over 300 subfolders containing over 30 Gb of data

This should be scriptable

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T11:59:31-07:00
by Bonzo
Write some code to read the directorys and use convert.

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T12:06:15-07:00
by elifafd
That i tried is was not working, my knowledge of scripting is not so good.


cd albums/
find . -print -type d |
while read dirctory
do
CD $directory
# /usr/bin/mogrify -format jpg *.psd
# cd -
done

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T12:08:16-07:00
by Bonzo
I am afraid I can not help with that as I use php and have dabbled with windows batch files.

If you wait hopefuly Anthony can give you some pointers.

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T13:37:11-07:00
by fmw42
elifafd wrote:That is no solution, i have over 300 subfolders containing over 30 Gb of data

This should be scriptable
Sorry but that is the fact of life with mogrify. Your only other choice is to write a script to do the work and use convert in the script.

Re: Mogrify on Linux from psd to jpg over multiple folders

Posted: 2009-08-10T14:40:21-07:00
by elifafd
find albums -iname "*.psd" | xargs mogrify -format jpg *.psd

is working fine, it is mogrifying now