• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 The uploaded image is too big. The uploaded file is too large.

#1
Getting this error when trying to upload an image file.

Untitled-1.jpg
I have seen several similar threads on this topic, but none that have a definitive answer. We are on a dedicated server and have completed control over it.

We have limited file sizes to 3600X3600 and 3Mb. When I try to upload an image large than that, instead of resizing it, I get this error. The same error appears whether we are using Imagemagick or GD.

We have removed the max upload size in the php.ini and we aren't seeing any errors in the php log or the website error log... yet we can't upload an image larger than our limits without getting the error when I thought the standard procedure was to resize the image automatically.

Please help!
 

Mike

XenForo developer
Staff member
#3
How big was the specific image? By default, images are only resized up to 20 megapixels which is 4000x4000; an image larger than that won't be resized due to the amount of memory it requires. You can increase this by setting this value higher in config.php:
Code:
$config['maxImageResizePixelCount'] = 20000000;
In terms of file size limits, note that we only resize the image based on dimensions. It's possible for the file size to still be too big after resizing. I don't think that's the error here though.
 

Mike

XenForo developer
Staff member
#5
Note that the value I provided (20000000) is the default. You can increase it as necessary, but you may need to increase PHP's memory_limit in php.ini (or config.php) or you could run into errors when resizing a large image.
 
#7
I've found that I can't upload straight from my DSLR camera, and some members with high end mobile devices are getting very large filesize and I assume high megapixel (4000x4000) sizes as well. I can't upload a bunch of files so I'll try this config change, hopefully it will resize them down.
 
#9
I think a little bit of love for the wording in the admin panel and the user dialog would go a long way to reduce confusion.

The admin control panel makes it seem like we will reject images over whatever dimensions we specify, instead of resizing them:


And the user dialog makes it seem like we will reject their images above certain pixel dimensions:



I got it working and it's a feature of Xenforo I love, but not before investigating the Good for nothing Kraken plugin and other options before discovering that Xenforo really does do image resizing, not just image rejections based on size.
 
Last edited:

Brandon Sheley

Well-known member
#10
How big was the specific image? By default, images are only resized up to 20 megapixels which is 4000x4000; an image larger than that won't be resized due to the amount of memory it requires. You can increase this by setting this value higher in config.php:
Code:
$config['maxImageResizePixelCount'] = 20000000;
In terms of file size limits, note that we only resize the image based on dimensions. It's possible for the file size to still be too big after resizing. I don't think that's the error here though.
I don't see this line in the config.php file
does it need to be added?
 

viper357

Active member
#13
By default, images are only resized up to 20 megapixels which is 4000x4000; an image larger than that won't be resized due to the amount of memory it requires.
So if I have an image that is 4128 x 2322 will it be discarded as one of the dimensions is above 4000?