I'm trying to create an images from uploaded .pdf with ImageCache.

But it works only if I commented this code (line 459)

if (!getimagesize($src)) {
watchdog('imagecache', '403: TEST1 File is not an image %image ', array('%image' => $src), WATCHDOG_ERROR);
header('HTTP/1.0 403 Forbidden');
exit;
}

I would like to request this feature :).
Thanks,
Ferry

Comments

truyenle’s picture

+Subscribe.

joel_guesclin’s picture

I would also like to request this feature. It seems absurd to me that this has not been done, especially since there is obviously a requirement, as specified here (and witness the numerous comments). I find it especially regrettable that the upgrades to Imagecache should break something that previously worked. Please... (pretty please :) ) can we have this feature back?
Also, I would like to ask Ferrylauda what his custom action code is for converting PDF to image (all I want is an image of the front page of the PDF, not an image for each page). Because I applied the change he suggested to the imagecache module but now it just says "La génération d'une image à partir de 20120201planning_0.pdf en utilisant le profil imagecache pdf a échoué." (ie the generation of an image failed)... which is not very informative!

babbage’s picture

Ah yes, upgrading Imagecache also broke this for me, while testing in dev.

Rather than commenting out those lines as Ferry suggested, a slightly less extreme approach is to modify the first of those lines to be:
if (!getimagesize($src) && (!$src['extension'] == 'pdf')) {

This then provides an exception in the way that commenting out would, but only if the file in question ends in the extension .pdf. A cleaner approach I think.
:)

fizk’s picture

Status: Active » Closed (won't fix)

This feature can be found in other modules on Drupal.org

derMatze’s picture

Can you tell me which modules these are?
I could only find modules that provide field types for uploading pdf and converting these files, but no imagecache action at all...