Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: ftforum on December 22, 2010, 01:13:42 PM

Title: JFIF Image uploading
Post by: ftforum on December 22, 2010, 01:13:42 PM
We have a user who has a .jpg file extension but the file is actually in JFIF format. When he tries to upload, it crashes and comes up with a security error. This is stange as I have disabled attachment security in admin.

Any ideas?
Title: Re: JFIF Image uploading
Post by: kat on December 22, 2010, 01:27:58 PM
Yeah. Tell the user not to use JFIF encoded images! :)

Easy enough to convert, after all.
Title: Re: JFIF Image uploading
Post by: ftforum on December 24, 2010, 04:44:56 AM
Well we have now had a whole host of complaints from people who do not have JFIF images and just standard jpg and stil get the message:

An Error Has Occurred! Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.

What's going on?
Title: Re: JFIF Image uploading
Post by: ftforum on December 24, 2010, 04:48:28 AM
And with recoding turned on we get...

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2365 bytes) in /home/ftf/public_html/forum/Sources/Subs-Graphics.php on line 424
Title: Re: JFIF Image uploading
Post by: kat on December 24, 2010, 08:21:34 AM
This error message usually springs up in a previously functional PHP script when the memory requirements exceed the default 8MB limit. Don't fret, though, because this is an easy problem to overcome.

To change the memory limit for one specific script by including a line such as this at the top of the script:

ini_set("memory_limit","12M");

The 12M sets the limit to 12 megabytes (12582912 bytes). If this doesn't work, keep increasing the memory limit until your script fits or your server squeals for mercy.

You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server's php.ini file:

memory_limit = 12M
Title: Re: JFIF Image uploading
Post by: ftforum on January 06, 2011, 03:30:58 AM
Thanks, problem now resolved.

I set the limit to unlimited on the PHP config but this resulted in the form script crashing (but the image actually uploading ok).

I changed the limit to a specified value until it worked (as suggested) and now it seems to work fine.

Title: Re: JFIF Image uploading
Post by: kat on January 06, 2011, 01:46:59 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.katzy.dsl.pipex.com%2FSmileys%2Fwoohoo.gif&hash=442d820e90e439f1b2b8366580a5ff975588fe3f)
Title: Re: JFIF Image uploading
Post by: nukinfuts29 on June 03, 2011, 05:50:27 PM
I'm having a VERY similar issue, except that my users can't post anything bigger than 86KB. Where could i enter these vairables to circumvent any possible issues?

http://www.simplemachines.org/community/index.php?topic=436338.0