I downloaded a bunch on images using wget, and unfortunately, there was a huge drawback...
The downloaded images had the same name! So, the script automatically appended .1, .2 , ...etc. at the end:
Accept-Male-User-icon.png
Accept-Male-User-icon.png.1
Accept-Male-User-icon.png.2
...
So, am looking for a script that would take these files and rename them according to their size, given that their size could be one of the following:
(256x256, 128x128, 64x64, 48x48, 32x32, 16x16)
So I end up with something like this:
Accept-Male-User-icon256.png
Accept-Male-User-icon128.png
Accept-Male-User-icon64.png
...
Thanks!!
If you have ImageMagick installed, you can try:
for a in *.png*; do mv -i $a ${a%\.png*}`identify -format '%w' $a`.png; done
Test it and if it works, remove the -i
switch after mv
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With