Introducing: bfi_thumb, alternative for timthumb

short story: rejected theme because of timthumb. I need to release the theme soon so I needed an alternative for timthumb that 1) allowed in TF, 2) used WP’s Image Editor classes, 3) can perform the timthumb functions I needed: grayscale, colorize/tint, and 4) can perform changing opacity of an image.

Aqua Resizer is awesome but I needed additional functionality. So, feeling inspired by Aqua, I created bfi_thumb. Some info below:

Bfi_thumb resizes image on the fly using WordPress’ Image Editor classes, thus supports both Imagick and GD and switches automatically depending on what’s available. The default Image Editors only have a handful of basic functions (crop, resize, rotate, etc), bfi_thumb also extends these classes to include these new functions: Grayscale, Color (colorize), Opacity.
Bfi_thumb stores previously created images in WP’s default uploads directory, and uses those for future calls. The script automatically checks for updates on the original image then re-creates new images when needed. Any image can be used as long it is in your WordPress instance.

I felt that other people might need this too.. so I made the code open and put it in Github under the GPL 3 license.

Yup in most cases, but in my case I’m using it on a body background pattern. The pattern is grayscale then the body also has a background-color. So to avoid any additional unwanted divs, I change the opacity of the pattern so that it’ll colorize the pattern. e.g. http://themes.mas.gambit.ph

Now that I think about it I can do it by colorizing the pattern instead. But I already finished the theme :/

Previously, you’d have to add ‘crop’ => true to the parameters, since that was how WP’s image editor classes did it.

I recently updated the script in Github to make cropping automatic depending on what dimensions you resize your image. Currently, if the aspect ratio of the dimensions you use doesn’t match the original one, it’ll resize then crop it similar to how timthumb does it.

Post Reply

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody