Add PNG Support to WordPress Plugin “Image Shadow”

The Image Shadow plugin for WordPress works pretty well. Unfortunately, it only adds shadows to JPEG images. PNG images can be added very easily, but they will be converted to JPEG format in the image cache. This isn't optimal for things like screenshots, but the images still look good enough for my needs.

Edit wp-content/plugins/image-shadow/image-shadow.php. Find this line:

if (!preg_match('/\.(jpeg|jpg|jpe)$/i', $src)) return $src;

Add |png to the match expression:

if (!preg_match('/\.(jpeg|jpg|jpe|png)$/i', $src)) return $src;

About Jeff Fitzsimons

Jeff Fitzsimons is a software engineer in the California Bay Area. Technical specialties include C++, Win32, and multithreading. Personal interests include rock climbing, cycling, motorcycles, and photography.
This entry was posted in Technology, Wordpress. Bookmark the permalink.

Leave a Reply

Your email address will not be published.