Closed (duplicate)
Project:
ImageField
Version:
4.7.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2007 at 12:31 UTC
Updated:
20 Apr 2007 at 00:54 UTC
Hi,
how can I force users to upload either jpeg or gif images, and not other formats like bmp or png ?
Bmp images are particulary a problem for they are not being resized properly.
Thanks a lot !
Comments
Comment #1
benbruscella commentedI don't think this is related to cck, it seems to be an image problem in general. My users reported this today and I don't have cck installed.
Comment #2
dopry commentedWe need better error reporting from the imagetoolkit. :) However, I think someone could roll a patch to test the file extension and make sure it is gif, jpg, or png.
Comment #3
m3avrck commentedThe extension is not the best way to test.
You can test the mime type of the object that is being uploaded, that is more robust. Use the function
http://us3.php.net/manual/en/function.getimagesize.phpto check this using a hook_validate() for the image upload field. A patch would be almost trivial. Unfort I have no time right now and have to run :-)Comment #4
quicksketchSorry I didn't see this issue, but I've uploaded a patch at http://drupal.org/node/132054 which does mime-type based validation defaulting to gif,png,jpeg types.