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.
Darrel and I were talking about the animated gif bug in IRC. This is caused by PHP's built-in GD not having the necessary libraries to deal with animated gifs.
A simple fix for this is to add an option to the field to "Enforce size restrictions without resizing" -- in other words, if this option is enabled, and I've entered 48x48 as the max dimensions for the image, if that image is not 48x48, it will kick the form back to the user with an error, rather than invoking GD to resize the image properly which is the current behaviour.
Comments
Comment #1
quicksketchSee http://drupal.org/node/119585 to continue discussion.
Comment #2
john.karahalis CreditAttribution: john.karahalis commentedI agree that this would be a useful feature, and I think I would have to disagree that http://drupal.org/node/119585 is a duplicate of this request.
Comment #3
john.karahalis CreditAttribution: john.karahalis commentedMoving this over to FileField.
The "automatic resize" functionality seems to be happening in filefield.module, line 757. With the following code, FileField attempts to resize an image that is too large:
Would it make sense for the module to do something like this instead?
Of course, an interface would need to be built to allow the user to specify whether or not he would like FileField to automatically resize images that are too large (the "filefield_resize_maximum" variable), but I think this would be an easy, useful improvement for the module.
Comment #4
el_reverend CreditAttribution: el_reverend commentedSubscribing. I'd like to see that the resizing will only happen on images that fall between certain dimensions specified. All other should just be rejected.
Why on a scale? Because it is almost impossible for the laymen users to hit an exact files size. Most user will get images from a camera, maybe use bundled software to minimally edit, but with file sizes getting bigger I would have to add A LOT more ram to my server, just to keep up.