Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When PNG image is uploaded, it's width and height are shown as zero. This doesn't happen for JPGs. When trying to generate thumbnails from such image, "FILE.png is not an image." error message is shown.
Environment: Drupal 6.1, IMCE 6.x-1.x-dev, PHP 5.2 (incl. GD), PostgreSQL 8.3.
Comments
Comment #1
ufku CreditAttribution: ufku commentedconfirmed. this issiue is valid for some php configurations where IMG_PNG constant is not defined.
committed a fix for the -dev branch.
Comment #2
ogi CreditAttribution: ogi commentedHappy to see this fixed, I rushed to look how it's fixed and I was very surprised.
array(IMG_GIF, IMG_JPG, IMG_PNG)
is replaced witharray(1, 2, 3)
?! This doesn't look like good coding practice. Are you sure you want to fix it this way? It's strange that I didn't find information about IMG_PNG not defined in some installations. Does this comment help for nicer solution?Comment #3
ufku CreditAttribution: ufku commentedHmm, It's now clear why IMG_PNG didn't work.
IMG_ prefixed constants may not be equal to IMAGETYPE_ prefixed constants.
It was a mistake to use the IMG_ constants because getimagesize() returns IMAGETYPE_ constants.
Thank you Ognyan for pointing this out.
I'll replace the integers with IMAGETYPE_ equivalents.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.