I'm not an ImageMagick whiz but while I'm trolling I may as well make myself useful.
You could try something like: find -name \*.jpg | sed 's#\(.*\)\.jpg#convert \1.jpg -fuzz 10% -trim +repage \1_new.jpg#' to see the commands that would be run, and if you're satisfied just pipe it to sh like so: find -name \*.jpg | sed 's#\(.*\)\.jpg#convert \1.jpg -fuzz 10% -trim +repage \1_new.jpg#' | sh basically it says find me all *.jpg below the current directory and pipe path to sed. then sed matches everything before the .jpg, and by wrapping it in parens we can reference it as \1 in the replacement text... if you only want files that are 2 levels deep find probably has an option for that. many ways to do it... this is just one of them --v Anna Choma wrote: > Hello, > > I have problems with trimming jpg files. They are stored in > subsubdirectories and I would like to trim them in one click. I use > such command > > convert */*/*.jpg -fuzz 10% -trim +repage *.jpg > > I don't know how to tell convert to gest inside each of the > subsubdirectory, convert the file (or mogrify, but with mogrify the > whole operation doesn't work) and make a copy of the original files or > overwrite the originals (so I tried with mogrify). > > Does anybody know how to do it? I think I should use regular > expression, but unfortunately I am not so advanced user of Linux. > > Thanks in advance, > > Best regards, > > Anna > _______________________________________________ > Magick-users mailing list > [email protected] > http://studio.imagemagick.org/mailman/listinfo/magick-users > _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
