• Welcome to Simple Machines Community Forum. Please login or sign up.

SMF 2.0.14 and SMF 2.1 Beta 3 - Attachment max image width/height ignored

Started by GL700Wing, June 03, 2017, 04:36:02 AM

Previous topic - Next topic

GL700Wing

I've got an SMF 2.0.14 forum (no mods) running on PHP 5.4 and today while doing some testing I started encountering server 'Error 500' conditions when attempting to upload images that are larger than 5000x2400 in size (physical size is less than 1Mb).

It took me a while to work out the approximate maximum file dimensions I could upload without throwing the error (ie, 4800x2300) and once I had this information I configured these values in Administration Center -> Features and Options -> Layout.  Unfortunately it seems these values are ignored during an attachment upload (I expected SMF to display an error message advising the image was oversize ) as the server 'Error 500' condition persisted.

I then created a new SMF 2.1 Beta 3 forum (also using PHP 5.4) to test if the max image width/height values could be configure and, if so, if they are checked during an image attachment upload.  It turns out these values are also ignored in SMF 2.1 but trying to upload a large image actually creates an unrecoverable error condition and things get really messy (see attached error message screens) - the only was I could get around the problem was to logout (even deleting the 'tmp' files from the attachments folder didn't help).

I have confirmed that this problem doesn't occur with PHP 5.6 (which I'll be able to switch to tomorrow after I migrate a vBulletin 4 forum to SMF 2.0.14) but I think the underlying issue is that SMF 2.0 and 2.1 are both ignoring max image width/height values specified for attachments - my understanding is that if these values were checked/enforced SMF would display an appropriate error message and the server 'Error 500' condition wouldn't occur.

(Ironically I tried to attach the 5120x4035 image - less than 1Mb in size - I was testing uploads with to this message but it threw an 'Error 500')
Life doesn't have to be perfect to be wonderful ...


GL700Wing

Quote from: Illori on June 03, 2017, 05:44:54 AMfor SMF 2.0 this mod can help with the issue https://custom.simplemachines.org/mods/index.php?mod=4111
Fantastic - thanks!!  Installed the mod and can now upload large image using default mod setting.
Life doesn't have to be perfect to be wonderful ...

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Illori

i do think we need to resolve this in SMF core, if at all possible.

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Illori

I think so. do you think something similar to the mod could be added to core? we get this coming up often and usually that mod fixes it, I think we should not require a mod to be installed a fix this.

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: