BASH script: resize pictures in zip archive

It's tested on CentOS 7.

Before use it, you must install zip, unzip and ImageMagick:
yum install zip unzip ImageMagick

Create a exectable file (it names "" here.) with Code below:
mkdir ./tmp
mkdir ./produced
for UNZIPFILE in $( ls *.zip ); do
 echo item: $UNZIPFILE
 mkdir ./tmp/$UNZIPCACHE
 find ./tmp/$UNZIPCACHE -name *.jpg -print -exec mogrify -resize x1308\> {} \;
 find ./tmp/$UNZIPCACHE -name *.png -print -exec mogrify -resize x1308\> {} \;
 find . -name *.txt -exec rm -f {} \;
 find . -name *.url -exec rm -f {} \;
 cd ./tmp
 zip -0 -r ../produced/$UNZIPFILE ./$UNZIPCACHE
 cd ..
echo done\!
unset IFS

You can change resize parameter with width x height like this:
 find ./tmp/$UNZIPCACHE -name *.jpg -print -exec mogrify -resize 512x1308 {} \;
or by percentage:
 find ./tmp/$UNZIPCACHE -name *.jpg -print -exec mogrify -resize 50% {} \;

Execute: copy to the directory that you wanna to resize, and execute it use ". "
# .

1. All zip archive files in directory will be resized.
2. Verify your permissions.
3. not use "./" like below when you execute it:
# ./
4. Only jpg and png will be resize.
5. It will delete *.txt and *.url in your zip archive file.
6. You must delete "tmp" manually after resizing done.



BASH script: resize pictures in rar archive

[Solved] If you forgot your f**king security question in Apple ID login portal