News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

smf 2.0 rc3 - Problem with JPG attachments

Started by thesicilian, March 21, 2010, 02:29:34 AM

Previous topic - Next topic

thesicilian

I've found an issue when attaching JPG's,

When attaching and posting the forum screen just goes blank. If you lucky one of the photo's will get attached to a main topic. When trying to reply to topic to add more photos, the forums just time out. I've got no issues with any other attachments, just JPG photo's.

I've tried disabling Display image attachments as pictures under post , still no joy. Also tried disabling Resize images when showing under posts, still no joy.

Any ideas?

thesicilian

Btw, the image sizes I've been trying to attached are 3264x2448 2.12mb.

They previously attached fine a board running SMF 1.1.8.

Kays

Hi, what version SMF and what is the size of the attachment. (in KB or MB)

Any errors in the error log?

Have you tried with a file that's less than 2MB?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

thesicilian

Sorry to sound such a noob, where do I find the log? Sorry first time I've set my own board up.

I just resized a photo 1632x1224 = 611KB, I tried to reply to a topic adding the photo, just kept timing out. I've zip & rar attachments of around 40MB on the board, so pretty sure size of attachment is not an issue.

thesicilian

#4
Sorry, just found the log, there's this error: -

[21-Mar-2010 00:36:51] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 6528 bytes) in /home/vuplussu/public_html/Sources/Subs-Graphics.php on line 415

thesicilian

Btw checked this using info.php

memory_limit=32M

Kays

PHP has a built in limit of 2MB, that's where I was coming from. It's also good to know what the size is.

That error is a memory limit error when resizing the image. Which shouldn't be happening since the limit is suppose to be temporarily increased to 90 MB.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

thesicilian

Quote from: Kays on March 21, 2010, 03:30:44 AM
PHP has a built in limit of 2MB, that's where I was coming from. It's also good to know what the size is.

That error is a memory limit error when resizing the image. Which shouldn't be happening since the limit is suppose to be temporarily increased to 90 MB.

Any idea how it can be fixed?

thesicilian

Just tested this on another board, different server same smf 2.0rc3. Same results, looks like its a bug in the actual board. Is it possible to fix this? Or am I better off starting again with 1.1.8 stable release?

sAce


thesicilian

Quote from: S-Ace on March 21, 2010, 07:29:29 AM
Quote1.1.8 stable release?

that be 1.1.11

Sorry, my bad :)

Any ideas anyone please? :)

Kays

I think I found a fix for it.

In Subs-Graphics about line 309 find:


require_once($sourcedir . '/Subs-Package.php');


and add after it:


@ini_set('memory_limit', '90M');

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

thesicilian

Thanks for the reply Kay.

Just tested. A resized photo of 1632x1224 = 611KB attached with no problems. The original 3264x2448 2.12mb looks like it times out as the browser window just goes all white, but ends up getting attached. Now you can only attach one photo at a time in this way. Even if you select say four photo's the browser goes all white and only one gets attached.

Is it worth increasing the 90M in this line to say 150M or something? @ini_set('memory_limit', '90M');   <<<< increase to 150M??


Kays

Yes, try increasing it.

I was using a 1.1 MB image and the php memory limit is set at 32 MB for my server. I didn't have a problem once that was added.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

thesicilian

Just increased to 150MB, all seems fine now :)

Thanks again kay, saved starting fresh again :)

Kays

Glad to hear that. :) Hopefully this should be fixed in the next release.

I'll mark this as solved then.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

BeerFizz


Hi,

We are having a similar problem with version 1.1.11 and we are unable to upload files of any type larger than 2-3MB.

I found the statement in question around line number 144 and inserted the suggested line after that, so I now have:


$success = false;
$sizes = url_image_size($url);

require_once($sourcedir . '/Subs-Package.php');
        @ini_set('memory_limit', '200M');

$fp = fopen($destName, 'wb');
if ($fp && substr($url, 0, 7) == 'http://')


Question:

As this still does not appear to work, do we need to restart the system (how?), restart browser, log out then log back in etc?

Thanks for all help
Phil

Kays

What you might be facing is a restriction in your php.ini file. 2 MB for upload is the default value.

You can create a phpinfo() file to check the setting. If that is the case you will need to contact your host on increasing the limit.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

BeerFizz

Thanks Kay,

sure enough there is a limit of 2MB.

Will have that changed and see how things progress.

All the best
Phil

BeerFizz

#19
Hi Kay,

I got passed the 2MB limit...

I have the attachment file size set to 502400KB, so approx 50MB.

However, I now appear to be running into a 10MB upload limit.  Is it possible to see if there is something hardcoded that is limiting the upload file size.

Unfortunately in my forum , we have the need to upload some very large files, even when zipped.

Thanks for all your help
Phil

ETA:  this is for all files, zip's etc and not just jpg's

Advertisement: