Mogrify on Linux from psd to jpg over multiple folders

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
elifafd

Mogrify on Linux from psd to jpg over multiple folders

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
elifafd

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

Post by elifafd »

That is no solution, i have over 300 subfolders containing over 30 Gb of data

This should be scriptable
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post by Bonzo »

Write some code to read the directorys and use convert.
elifafd

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

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
elifafd

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

Post by elifafd »

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

is working fine, it is mogrifying now
Post Reply