Ben Posted October 26, 2012 Share Posted October 26, 2012 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! Link to comment Share on other sites More sharing options...
Ben Posted October 26, 2012 Author Share Posted October 26, 2012 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". 2 Link to comment Share on other sites More sharing options...
alan Posted May 2, 2013 Share Posted May 2, 2013 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? Link to comment Share on other sites More sharing options...
horst Posted May 2, 2013 Share Posted May 2, 2013 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? 1 Link to comment Share on other sites More sharing options...
alan Posted May 3, 2013 Share Posted May 3, 2013 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 Link to comment Share on other sites More sharing options...
horst Posted May 3, 2013 Share Posted May 3, 2013 Alan, have you seen this thread: http://processwire.com/talk/topic/3476-fixed-image-size/#entry34110 ? Link to comment Share on other sites More sharing options...
alan Posted May 3, 2013 Share Posted May 3, 2013 No I hadn't see it Horst—thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now