PHP Get Character Frequency
Cache Slow Pages for Performance
Youtube subscription Checker
Resizing images in PHP
Zip a File with PHP
Getting next auto_increment value from Mysql
Install PHP, MySQL, Apache the Bullet Proof Way
Benchmark your PHP with 3 lines of code
See all 8 posts
Php Tutorials RSS
video tutorials (123)
funny pictures (41)
amazing videos (27)
hilarious videos (26)
amazing pictures (21)
php tutorials (8)
computer tricks (7)
personal updates (6)
cat videos (5)
youtube tips (3)
fake news (2)
Best of Internet
Streaming Anime Episodes
Free Video Tutorials
Best of Youtube
MP3s From Google
Free Online Education
Funny Pictures Blog
Video Game Sheet Music
Free Movies Online
|Resizing images in PHP Posted on Thursday, February 14 2008|
Let's say you want to post pictures to your blog, but they exceed the width by far too much, and you don't want to resize smaller images. The solution is image magick which works on linux, mac and windows. You can access it directly using exec() functions in php or you can use a frontend, wrapper, whats-am-a-call-its like magick wand and imagick. I just use the command line.
Examplemogrify.exe -format jpg -quality 80 -resize "700>" -sharpen 0x0.5 "C:\images\*.*"
This says I want to convert all files in C:\images into jpegs of quality 80. If the width is greater than 700 resize it to 700. Sharpen all images.
Mogrify overwrites the files while convert generates new ones. See this page for all command line utilities and arguments. Imagemagick is something all developers should use. For an insane amount of simple examples see the imagemagick examples page. If you use one of the wrappers the documentation with examples is provided with the download.
I had used it to figure out how youtube calculates which frame to use as a thumbnail. I generated thousands of numbered bitmaps and made them into an avi to try to find the correlation.
Tags: image magick, imagemagic, imagemagick, imageick, cli commandline, command line interface
More OMFG-Good LinksSee all Posts in the Funny Pictures category.
Download mp3s faster than limewire using google.
I've made 100+ free video tutorials.
See the best of the internet today on one page.