346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

Hey guys,

A little help to those who’ve used Timthumb before.

So I just finished a WP theme, but when I was testing it online, the filters for Timthumb weren’t being applied at all on my images.

Here’s an example:

http://themes.amplus.gambit.ph/wp-content/themes/amplus/functions/timthumb.php?src=http://themes.amplus.gambit.ph/wp-content/uploads/2011/02/12979795614923485443_a1967ff888_b.jpg&w=860&h=300&f=5,255,0,0,0

That image should be tinted red because of the GET parameter f=5,255,0,0,0. This is tinted red when I do it locally, but it no filters are applied when it’s online. There’re no PHP errors showing up, and the uploaded code is already tested locally without a hitch. The permissions of the folders are correct, the file is locally available, the PHP version is high enough, GD is supported, everything looks okay.

Anyone got a clue why this is happening? I couldn’t find search online for answers.

346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

omg, this has something to do with Ubuntu not providing the default package of GD. Anyone knowledgeable in this?

58 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Sold between 250 000 and 1 000 000 dollars
DigitalCavalry says

Yes, TimThumb need GD (maybe in bundled version), and server must have CULR or urlfopen enabled, this information you can find in timthumb file. Maybe cache folder don’t exist or timthumb don’t have access to this folder. Maybe server is blocking timthumb file from executing.

346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

Yes, TimThumb need GD (maybe in bundled version), and server must have CULR or urlfopen enabled, this information you can find in timthumb file. Maybe cache folder don’t exist or timthumb don’t have access to this folder. Maybe server is blocking timthumb file from executing.

Timthumb is already working, it’s the filter that’s the problem :(

Just found out that doing function_exists(‘imagefilter’) yields false in online server, but it’s true in my local one.

58 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Sold between 250 000 and 1 000 000 dollars
DigitalCavalry says

So the problem is GD library. I f I good remember imagefilter function is implemented in bundled version.

346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

If ever someone else encountered this problem, DigitalCavalry is spot on. The bundled version is needed by PHP , and TimThumb doesn’t throw any errors if this is not the case.

If you are using an old version of Ubuntu (like me), update the distribution to 10.04. This is faster and better than compiling your own copy of PHP just to get the GD bundled version. :)

by
by
by
by
by
by