Home · Latest · Trends  /  general
0

Convert high resolution images for web

rated 0 times [  0] [ 0]  / comments: 0 / hits: 386  / 3 yaers ago, thu, feb 23, 2017, 11:44:46
The following will resize images so they'll be lighter and load quicker.. as well as take up less room. It will resize images larger than 1024x683 to 1024x683.
#!/bin/bash
for i in $(find /path/to/image/directory/ -name "*.jpg")
do

echo "I am resizing the $i image....."

# writes to a new file, the old one survives
#convert -resize 1024x683 $i

# writes to the same file, the old one will vanish
mogrify -resize 1024x683 $i

echo "Image $i has been resized."

done
More From » general
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
rob

rob

Member since Feb 22, 2017
Total Code Snippets: 127
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017