Create Image Thumbnails with ImageMagick
ImageMagick is, for lack of better term, magic. You can throw just about anything at it and succeed. With that in mind, I was recently using Google Page Speed to see how I could improve my website and it occurred to me I wasn't generating thumbnails for my post lists -- I was simply scaling down preview images with CSS. Certainly not the most efficient technique you've ever heard of. ImageMagick to the rescue -- now I can parse for images and generate thumbnails to make my site much faster to download!
ImageMagick is loaded with options but the syntax to generate a thumbnails is dead easy:
convert billboard.png -trim -resize 32x32 thumbnail.png
Instead of simply scaling down an image with CSS, I should be generating a thumbnail and serving that up instead. And since it's so easy to do so, there's really no reason not to!
![Being a Dev Dad]()
I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...
![How I Stopped WordPress Comment Spam]()
I love almost every part of being a tech blogger: learning, preaching, bantering, researching. The one part about blogging that I absolutely loathe: dealing with SPAM comments. For the past two years, my blog has registered 8,000+ SPAM comments per day. PER DAY. Bloating my database...
![Introducing MooTools LazyLoad]()
Once concept I'm very fond of is lazy loading. Lazy loading defers the loading of resources (usually images) until they are needed. Why load stuff you never need if you can prevent it, right? I've created LazyLoad, a customizable MooTools plugin that...
![Add Styles to Console Statements]()
I was recently checking out Google Plus because they implement some awesome effects. I opened the console and same the following message:
WARNING!
Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS.
Do not enter or paste code that you...
There is a
-thumbnail
option to create, you’ve guessed it, thumbnails : http://www.imagemagick.org/script/command-line-options.php#thumbnailAnd if you need to do it on the fly, here’s a chainable wrapper for GD (PHP): https://github.com/claviska/SimpleImage