Download & Extend

Incorrect error message regarding required image size

Project:ImageField
Version:6.x-3.0-rc1
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I have imagefield set to require an exact image size, so I've specified the maximum and minimum image resolutions to be the same thing, e.g. both set at 100x100. If I try to upload an image that is larger, I get the error message:

The selected file xxx.jpg could not be uploaded. The image is too small; the minimum dimensions are 100x100 pixels.

imagefield 6.x-3.0-rc1
cck 6.x.2.2
files 775, tmp 775
public download

Thanks.

Comments

#1

I think what's probably happened is that you uploaded an image that's not an exact multiple of 100x100. An image 200x200 for example would actually be accepted since it would be scaled down to 100x100 and then pass the minimum dimension. However an image 200x100 would be scaled down to 100x50, then it would fail the minimum dimension.

Anyway, I agree that the message is misleading and in the case of exact dimensions, we should check everything all at once.

#2

Status:active» fixed

I've committed this patch to add a few more conditionals to the image resolution check. Now the messages handle the special cases of an image not fitting within the dimensions after resizing.

The new messages:
The image must be exactly %dimensions pixels.
The image will not fit between the dimensions of %min_dimensions and %max_dimensions pixels.

Plus I added a few tests to help prevent this from happening again in the future.

AttachmentSize
imagefield_dimension_messages.patch 4.51 KB

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here