Image Magick - Resize pictures in all subdirectories
Heey guys,
I'd like to resize a lot of pictures which are in subdirectories. all the pictures are stored in /home/username/Pictures With Image Magick I can resize a single picture by: Code:
convert -size 1024 somefile.jpg -resize 1024 ./newsize1024/somefile1024.jpg Can u guys help me out with a command, bash script, c code or some other code? (i prefer the easiest way) thnx in advance! McDuck Additional: can the solution contain the solution to resize the picture to the highest dimension? currently: convert (from the image magick package) has a -resize option. this option can only resize to the maximum width, eg: Code:
convert -resize 1024 somefile.jpg but with picture size: 1572x2048 to 1024x1334 desired: which would output: 1024x786 and 786x1024 |
Let me mention a typo - 1024x768 is the usual size.
Unless you have a bundle of pictures, you might be quicker doing it by hand. use find (man find) which descends subdirs [ find <options> |xargs do stuff and go chase gimp scripts (script-fu) to see if they can automate some of the messing. |
Quote:
Code:
convert -resize 1024x1024 input.jpg output.jpg Code:
2048x1572 --> 1024x786 |
Thnx for the fast replies!
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
Code:
while read file This creates the new file in the same directory as the original file. If you want all the new files in one specific location (as in your example) first you have to extract the file name. Here is an example using substring removal: Code:
while read file |
All times are GMT -5. The time now is 04:41 AM. |