Jump to content

Recommended Posts

Posted

I was wondering if anyone had experience with placing a threshold on the size of an upload using the images field. It doesn't matter if the constraint is by dimensional/pixel area or by kilobytes, the point is to only to keep gigantic camera jpegs off the system. Limiting the global php upload maximum isn't an option because the site needs to handle pdfs and other media. While the optimum strategy would resize the image programatically on upload (if it exceeds certain conditions), throwing an error would also be fine.

Poking around InputfieldImage.module, I'm seeing maxWidth and maxHeight properties (applied in ___fileAdded the method) that look like they would be perfect, but I can't figure out to apply the settings to the field.

Thanks!

Posted

Nevermind, I must be blind. The setting is in the images field setup on the input tab - the last field in the fieldset, "Max Image Dimensions".

  • Like 2
  • 6 months later...
Posted

Hmm. I just implemented this limit (set width to 850 so images 851 and wider would be re-sized down at upload).

Now when I add an image of over 851px wide it appears to barber-pole it's way up to 100% loaded but then never displays the image.

I removed the restriction and now normal service is resumed and images are able to be uploaded again. Any ideas anyone?

Posted

Hi Alan, I have tried it here and it works!

Does you try it online or local?

Maybe one/some needed folder isn't availbale or not writeable.

Any entry in errors.log?

Turn on debug?

  • Like 1
Posted

Thanks horst, I think I had debug on and it was local, but I (again) forgot to look in errors.log, thanks for the reminder, I will go check it :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...