I created a content type with a Imagefield. Set "Maximum resolution for Images" to 50x50. The text just below this says: "The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction. If a larger image is uploaded, it will be resized to reflect the given width and height."

But when I try to upload a larger image, I get: "The selected file lazy.jpg could not be uploaded. The image is too large; the maximum dimensions are 50x50 pixels."

What am I doing wrong?

I use:
- Drupal 6.8
- CCK 6.x-2.1
- Imagefield 6.x-3.0-alpha3

(BTW: "The ImageAPI GD2 module is the only enabled image toolkit. Drupal will use it for resizing, cropping and other image manipulations."

Comments

magoo’s picture

AFAIK, imagefield does not perform resize. It handles images for CCK.

The dimension you defined are to force the ones of the uploaded images.

If you want resizing, You will need to install either imagecache and create a profile for the dimension you want or try Imagefield Crop

michaelfavia’s picture

Status: Active » Closed (works as designed)

This is correct. If you wish to have the image saved in its large state and have a scaled and or cropped derivative of that image shown you need to install imagecache and not enforce your file sizes.

tanc’s picture

I just came across this problem too. I may have misunderstood the descriptive words: "If a larger image is uploaded, it will be resized to reflect the given width and height." This text is part of imagefield displayed both when setting a maximum in the cck content type and when creating/editing a node, yet when a larger image is uploaded no resizing happens. I'm pretty sure this used to work in older versions of imagefield and its my understanding that imagefield uses Image API to do the resizing.

Imagecache is different and is used to provide custom resized images when the field is displayed.

If imagefield no longer resizes I suggest changing this text.

tanc’s picture

OK, I think I know what happened. The server I was trying this on didn't have GD installed and also the temporary directory specified in admin/settings/file-system was incorrect which was stopping any scaling from working. Once I fixed these two problem the image resizing worked perfectly. So really the issue is 90% with the user not configuring their server properly and 10% with imagefield not giving a better error message or hint as to the problem.

tejbir’s picture

I have also got the error that image is to large to upload can not resized for IIS server

learning from comment no #6 in http://drupal.org/node/301866

make changes as

-------------------------
In /includes/image.inc, change line 117 from:

if (!is_file($file)) {

to:

if (!is_file($file) && !is_uploaded_file($file)) {
-------------------
change line 81 in /includes/image.gd.inc

if (!file_exists($source)) {

to

if (!file_exists($source) && !is_uploaded_file($source)) {

-------------------------

AND IT WORKED

lwithrow’s picture

I agree that the help text is confusing. It shouldn't say "it will be resized" if it's not going to be resized. I would love to see options that say something like "[ x ] Ignore maximum values on resize" and "[ x ] Ignore minimum values on resize"

And perhaps make the help text say something like:

The maximum allowed image size expressed as WIDTHxHEIGHT (e.g. 640x480). Set to 0 for no restriction. If a larger image is uploaded, it will be resized to reflect the given width and height (unless doing so would violate the minimum dimensions). Resizing images on upload will cause the loss of EXIF data in the image.