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

benbruscella’s picture

I 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.

dopry’s picture

Title: bmp files not resized » restrict image uploads to types that can be handled by gd.
Category: support » feature

We 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.

m3avrck’s picture

The 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.php to 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 :-)

quicksketch’s picture

Status: Active » Closed (duplicate)

Sorry 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.