# Max file size for attached images



## LoREvanescence (Jun 19, 2007)

Lately I have been finding that I can't drag and drop any image into post that was taken on my iPhone XS Max. I'm also finding that most images on my clipboard also do not copy and past into the post.

The image looks like it's going to attach, and the loading icon appears on the top right while the image appears in the post box. But then 15 seconds later or so the image just disappears and is not attached. There is no error message.

I went through this on an other forum and helped them figure out why.

The reason why this is happening is MacOS changes the format of an image when I drag and drop it into the post. It always drops a .png graphic which obviously has less compression than a jpg. Same goes from images copied to the clipboard. 

The png graphic is above the maximum file size allowed by the forum. The solution for this was to allow larger file sizes and allow the forum to handle compression / resizing of the image. Otherwise I have to open every image I want to attach in photoshop, resize and save out as .jpg.

The png format appears when any live image is dragged and dropped. Or if you drag and drop an image out of an app, such as messenger or photos.


Is it possible we can allow for larger file sizes for images and allow the forum to handle the resizing?


----------



## Mike Lang (Nov 17, 1999)

I don't think auto-resize is built into Xenforo.


LoREvanescence said:


> There is no error message.


There is...


----------



## LoREvanescence (Jun 19, 2007)

That error doesn’t show when you drag and drop an image into the text input box. Same as copying and pasting one. Instead of showing an error the image just vanished. That error does however pop up if you go to attach and image and brows for it. 


Sent from my iPhone using Tapatalk


----------



## dianebrat (Jul 6, 2002)

@LoREvanescence 
There are several things in your initial post that I feel can use comment, inherently PNG can compress as much as JPG it all depends on how you set it in the save process, it's not like you're saving BMPs.
I also don't feel that in this day of multi-megapixel cameras that we should not respect the fact that TCF pays for storage of these images when most of us do not need full resolution on items we post, 1/8 resolution should be fine and we should be able to provide an image that meets the needs of the forum, but that's IMHO.


----------



## LoREvanescence (Jun 19, 2007)

dianebrat said:


> @LoREvanescence
> There are several things in your initial post that I feel can use comment, inherently PNG can compress as much as JPG it all depends on how you set it in the save process, it's not like you're saving BMPs.
> I also don't feel that in this day of multi-megapixel cameras that we should not respect the fact that TCF pays for storage of these images when most of us do not need full resolution on items we post, 1/8 resolution should be fine and we should be able to provide an image that meets the needs of the forum, but that's IMHO.


In terms of PNG. They can not be compressed as much as JPGs. And you need to use TinyPNG to compress them more than the standard 8, 16, 24 or 32 bit colors. Or change the resolution.

As for TCF storage, I'm not saying that TCF should store larger images. On an other XenForo forum I frequent, I don't know if it's an add on our built in. But the forum will resize and compress the images uploaded. I'm hoping the same can be done here. So for example, upload a 12MB PNG image and have the forum process it upon upload and store a 500k image.

Generally when I post images, I post them from my Mac, not my Phone. To get access to those photos I view them in the "Photos" app. Dragging the image over to the text input box.

When doing that, MacOS stores the image in your clipboard, and converts to a png. You have no control on compression. Id just like to avoid the step of having to open every image photoshop to resave to be able to attach.


----------



## dianebrat (Jul 6, 2002)

LoREvanescence said:


> When doing that, MacOS stores the image in your clipboard, and converts to a png. You have no control on compression. Id just like to avoid the step of having to open every image photoshop to resave to be able to attach.


So there's actually something that's easier with Windows? I'm impressed. I don't need photoshop or any 3rd party to resize my images, I can do it with lowly MSPaint and a couple mouseclicks, easy peasy.


----------



## Mike Lang (Nov 17, 1999)

You don't even need to open a program in Windows. Just right click on the image file and hit resize.

How to use Image Resizer for Windows


----------



## LoREvanescence (Jun 19, 2007)

@Mike Lang

So the issue is the server configuration and not XenForo.

In php.ini, the following settings need to be increased.


upload_max_filesize
post_max_size

If those are increased in size images will not fail to attach for being too large. If a max file size or resolution is set in the XenForo admin panel the file will be processed by PHP's built-in GD image library or Imagemagick PECL Extension depending on which you have selected.


----------



## Mike Lang (Nov 17, 1999)

I spoke with David and we won’t be making any changes at this time. 

Please use any of the several image resize options available.


----------



## LoREvanescence (Jun 19, 2007)

Mike Lang said:


> I spoke with David and we won't be making any changes at this time.
> 
> Please use any of the several image resize options available.


Just a pain because I can't do that on my phone.

That's okay if you don't make the changes right now. I don't upload many pictures and was trying to be helpful with solving the problem.

I can confirm that if you set a max file size of say 800k, XenForo will resize the image so it does not exceed 800k. I have this working over at Needles & Grooves

We have a lot of users that upload a lot of pictures. And we got all kinds of complaints about images being too large and not being able to attach from phones. Found the solution here: XF 2.0 - Help with increasing Max Attachment size


----------



## David Bott (Jan 1, 1999)

upload_max_filesize
post_max_size
Just an FYI...We have our MAX upload size in the PHP.INI file settings set for 20 MEG. So no idea what you are trying to upload that is a photo that is more that 20 MEGs.


----------



## LoREvanescence (Jun 19, 2007)

David Bott said:


> upload_max_filesize
> post_max_size
> Just an FYI...We have our MAX upload size in the PHP.INI file settings set for 20 MEG. So no idea what you are trying to upload that is a photo that is more that 20 MEGs.


Might be the post_max_size.

I'm not trying to upload anything different than a picture taken on a iPhone XS MAX.

So they should fall about approximately what is listed below:



> Photos taken on the iPhone X are approximately 3024 x 4032 in resolution, or *2.93MB* using Apple's storage compression methods.


----------



## Mike Lang (Nov 17, 1999)

LoREvanescence said:


> Might be the post_max_size.


Also 20MB.


----------



## El Gabito (Mar 11, 2004)

It's definitely not 20MB, I just tried to upload an image from my laptop that was 2.9MB and got a filesize error. I reduced them to 600-700KB and was fine. I think this size is perfectly reasonable (arguably still to large for what's needed here), but just to clarify that there's no way the limit is 20MB per file.


----------



## dishrich (Jan 16, 2002)

I just tried to upload 2 docs to a post - one 6mb & the other 15mb & neither one will post


----------



## Mike Lang (Nov 17, 1999)

I think it's 3mb now. Host anything bigger on something like Dropbox & link to it.


----------



## dianebrat (Jul 6, 2002)

dishrich said:


> I just tried to upload 2 docs to a post - one 6mb & the other 15mb & neither one will post


I'll ask, what are you posting as a 15MB attachment?


----------



## dishrich (Jan 16, 2002)

Well honestly, all it was was a B&W copy of a single page of a Comcast bill...not sure how it scanned THAT large, as I used the same settings as the 6mb doc - but I rescanned both at reduced size & got them posted now.


----------



## dianebrat (Jul 6, 2002)

dishrich said:


> Well honestly, all it was was a B&W copy of a single page of a Comcast bill...not sure how it scanned THAT large, as I used the same settings as the 6mb doc - but I rescanned both at reduced size & got them posted now.


Then I'd say the forum limit is doing its job!
People like to scan and go without looking at what they just did, when I scan something like a bill it's 300dpi and B&W it doesn't need anything more.


----------



## HerronScott (Jan 1, 2002)

View the scan on your computer and use the Snipping Tool to grab an image and paste it directly into the message.

Scott


----------

