LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   working example to create a small archive of your photos using convert (imagemagick) (https://www.linuxquestions.org/questions/linux-newbie-8/working-example-to-create-a-small-archive-of-your-photos-using-convert-imagemagick-4175460665/)

rmcknight 05-04-2013 04:14 AM

working example to create a small archive of your photos using convert (imagemagick)
 
First create a duplicate folder for your archive based on your orig structure (with no files).
For me /data/all_photos is where the big originals are, and i want copy put in /data/small

Code:

cd /data/all_photos
rsync -av -f"+ */" -f"- *" . /data/small

then, put this is a nice bash script (called rgm) in location say /data
{replace *123*.JPG with * or whatever you want}

Code:

while read file
do
oufile="${file:2}"
  convert -monitor -resize 1024x1024 "$file" "/data/small/${oufile}"
done < <(find . -name \*123*.JPG)

then
just run your command with
Code:

/data/rgm
{make sure your pwd is your photo root folder - for me /data/all_photos}

if you need convert, then get it using
Code:

sudo apt-get install imagemagick --fix-missing

sycamorex 05-04-2013 04:52 AM

Hi and welcome to LQ.

Thanks for the howto. Can you please wrap your code with the code tags? It will make it so much more readable. Thanks


All times are GMT -5. The time now is 02:50 AM.