We're doing some things with .getJSON and a custom Drupal module. It's important that we know an image's height before we print any HTML. To do this, we call

$image = imageapi_image_open($path); // The imagecache PRESET path, not the original!
$height = $image->info['height'];

It works like a charm — unless the image is new. If it's new, and imagecache hasn't yet created - the height comes back as 0. This results in a collapsed DIV in our output and a whole heap of problems.

Is there a way to force imagecache to do its work on request, rather than having to request the altered image in the browser?

Thanks!

Comments

sandrewj’s picture

Status: Active » Closed (fixed)
imagecache_generate_image($presetname, $filepath)

with the original image path.