Automatic image sizing with static delivery – WordPress Enhancement

Recently I got fed up trying to convince the operators of a client, for whom we had implemented a wordpress site. The operators, even after we repeatedly asked to upload only relevant sizes for certian positions, were trying to make one size fit for all. Hell, places where thumbnails of 1 to 2K would suffice, were being used up by 30K images, resized by our theme constraints. We were running wordpress on lighttpd.

I was already attracted towards the imagemagick, and we are already on ubuntu server os. So instead of using the php-gd library, I created a wrapper which would run the convert tool of imagemagick and do the resizing for us. Also to keep the aspect ratio as far as possible, I dropped in a bit of AI to detect the target image size, and aspect ratio. Deciding how to resize, and where to crop. I asked my associates to use a regexp replace with the dimensions we were going to use in thumbnails. This code was added to the template pages.

This was how I configured our wordpress on lighttpd, yea I know there is nothing fancy there, and the hostname is purposefully taken out. The php code is added as a download PHP ImageMagik Resize Tool (458)

The PHP development team announces the immediate availability of PHP 5.6.29. This is a security release. Several security bugs were fixed in this release. All PHP 5.6 users are encouraged to upgrade to this version.For source downloads of PHP 5.6.29 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The […]

The PHP development team announces the immediate availability of PHP 7.1.0. This release is the first point release in the 7.x series.PHP 7.1.0 comes with numerous improvements and new features such asNullable typesVoid return typeIterable pseudo-typeClass constant visiblity modifiersSquare bracket syntax for list() and the ability to specify keys in list()Catching multiple exceptions typesMany more […]

The PHP development team announces the immediate availability of PHP 5.6.28. This is a security release. Several security bugs were fixed in this release. All PHP 5.6 users are encouraged to upgrade to this version.For source downloads of PHP 5.6.28 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The […]