Resize (*.jpg) -> Rename -> Compress (xyz.tar) ?
Hello there
I am looking for a single line command that does the following: 1) Resize all *.jpg files in a given folder using convert function from imagemagick 2) Append the resized file names with _resized before the .jpg extension. 3) Create and pipe this data to a tar archive. The following command resizes the images but I do not know how to proceed? find . -name "*.jpg" -exec convert '{}' -resize 800x600 '{}' \; Thank you very much |
Okay there is an improvement:
for i in `ls *.jpg`; do convert -resize 800x600 -quality 90 $i resized_$i; tar -rvf pics.tar conv_$i; done But I still do not want the files to be created, and would rather forward the stream directly to tar. Any help?? |
Okay here is my solution:
for i in `ls *.jpg`; do convert -resize 800x600 -quality 90 $i resized_$i; tar -rvf pics.tar resized_$i; rm resized_$i; done Perhaps someone can do better? |
Quote:
Code:
for i in *.jpg; do edit: I'm a dunce. This doesn't work, but I don't know why. However, the part about not needing ls is true :D |
Quote:
|
Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:16 AM. |