Download & Extend

Image validator has inaccurate message

Project:Drupal core
Version:7.x-dev
Component:file system
Category:bug report
Priority:normal
Assigned:quicksketch
Status:closed (duplicate)
Issue tags:D7FileAPIWishlist, ImageInCore, Quick fix

Issue Summary

In the file_validate_is_image() function we're reporting an inaccurate message. Currently we say that only PNG, JPG, and GIF images are supported, when in fact any image supported by PHP's getimagesize will pass (such as PSD, TIFF, PICT, etc.)

This functionality may get even more blurred with #269337: Support for more image types (PDF, TIFF, EPS, etc.), in which additional types such as PDF or EPS might become supported. So the easy solution is simply to fix this message. This is a forward-port from FileField in Drupal 6.

AttachmentSizeStatusTest resultOperations
file_validate_is_image_message.patch564 bytesIdleFailed: 11601 passes, 1 fail, 0 exceptionsView details | Re-test

Comments

#1

Status:needs review» needs work

The last submitted patch failed testing.

#2

Status:needs work» needs review

Well I thought I fixed that test, but must not have made it into the patch.

AttachmentSizeStatusTest resultOperations
file_validate_is_image_message.patch1.28 KBIdlePassed: 11477 passes, 0 fails, 0 exceptionsView details | Re-test

#3

I haven't tested that function on other formats but if you take a look at image_get_info() you'll see that only those three types set an extension.

#4

Status:needs review» needs work

Oh a good point, maybe this should wrapped into #269337: Support for more image types (PDF, TIFF, EPS, etc.) then?

#5

Status:needs work» closed (duplicate)

quicksketch yeah that seems like the best place for it.

nobody click here