Extract new image dimensions from timthumb

Posted by jonthoughtit on Stack Overflow See other posts from Stack Overflow or by jonthoughtit
Published on 2012-09-21T20:47:02Z Indexed on 2012/09/21 21:39 UTC
Read the original article Hit count: 217

Filed under:
|
|
|
|

I'm using timthumb to resize my images because it scales them nicely if I only enter one of the dimensions. However I want to know if it's possible to extract the new resized image's dimensions so that I can add that dynamically to the img tag attributes.

I tried this with no luck:

$fullpath = '/lib/timthumb.php?src='.$image.'&w=100';
$my_image = array_values(getimagesize($fullpath));
list($width, $height, $type, $attr) = $my_image;

Any ideas?

© Stack Overflow or respective owner

Related posts about php

Related posts about image