XF 2.0 Image Size and Dimensions Question

dash

Active member
In Xenforo 1.x, My understanding is that if you had a Maximum Attachment Size of 5MB and Maximum attachment image dimensions of 1920 x 1080 it will then follow this logic:

Uploaded files are first resized based on the maximum physical dimensions (pixels) set in the ACP -> Options -> Attachments: Maximum Attachment Image Dimensions. If the resized image is below the maximum file size (KB) limit, then it will be allowed. See link...

https://xenforo.com/community/threads/maximum-attachment-image-dimensions-explain.57372/post-610928

Is this still the case in Xenforo 2.0? I have the numbers set at 5MB and 1920 x 1080p and if someone uploads a file that is larger than the 1920 x 1080p dimensions it gets rejected even if the file size is very small (under 1MB). The error states: The uploaded image is too big.
 
Is this still the case in Xenforo 2.0?

Yes.

I just tested using an image which is 2000x2000 and 1100KB file size. In the options my maximum are set to 1600x1600 with (500KB Maximum attachment file size). No problem uploading the test image which was reduced to 1600x1600 and is now 426.75 KB file size.
 
I need some help here...My "Maximum attachment image dimensions:" is grayed out. I can't set a width x height. Is there a setting superseding this setting that is not allowing me to set the dimensions?
 
Made the abstractdriver.php changes and set my dimensions to 800 x 800 in Setup > Options >Attachments, but it doesn't seem to resize oversized images that have already been posted.
 
OK, thanks, @Mike. I thought maybe I had to do something else. I only have one member who posts gigantic pictures. If I edit her few posts, by saving her images, deleting them from the post, and reposting them back in, will it resize them...or are they there forever? Or I guess I could just download them and resize them myself and then replace them. You have to scroll to see the entirety of each of her pics.
 
Ok...I did a lot of experimenting to find out what the problem is. There is a small quirk with the "Maximum attachment image dimensions".

My previous settings were 2MB - Maximum attachment file size
and 1920 x 1080p Maximum attachment image dimensions
$config['maxImageResizePixelCount'] = 30000000;

If I tried uploading a picture of 1921 x 1081, total pixels are 2,076,601 which is much less than the 30M limit I have in maxresizepixelcount. However Xenforo states "The uploaded image is too big" because BOTH the height and width are 1 pixel too big. If only 1 dimension is bigger (but still under the maxresizepixelcount) it will work.

Hence the solution is to fill out either the width OR height in the pixels for maximum attachment image dimensions not both. I use 1920 as the width and leave the height blank. Now I can upload any size files upto 30,000,000 pixels and Xenforo will resize it down to a 1,920 width and appropriate height. I believe this is the behavior that most forum owners want. Really should be described better.
 
because BOTH the height and width are 1 pixel too big. If only 1 dimension is bigger (but still under the maxresizepixelcount) it will work.

I don't think this is correct. See my post #3, both the width and height of my test image were larger, yet it resized just fine.
 
Maybe something is set up differently on my system. When I set both dimensions in the ACP and go over by 1 pixel on both, the upload was rejected. Not sure why my system was experiencing that behavior. Works fine with only 1 set.

EDIT: Did a few more tests....and most images that were bigger by a few pixels on both dimensions were rejected but a few went through. No explanation. Easier just to set the width only.
 
Last edited:
why wouldn't the system have a baked in resize tool if we're setting resolution limits?

the error should also be more specific other than "Oops" please
 
Last edited:
Top Bottom