News:

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

Main Menu

Can't upload JPG, but MP3's are OK?

Started by tfs, May 04, 2009, 10:18:31 PM

Previous topic - Next topic

tfs

For about the last ten days I have had a problem uploading large JPG files to my forum.  I've been thinking it was a problem with Media Gallery because that's what I've been trying to upload with, but it turns out that SMF has the same problem when attaching files to a post.

Note that the problem happens with JPG files, but not with MP3 files, which are the only two large filetypes I have been attempting to upload.  The MP3's are on the order of 3-5 megabytes, and I can upload a dozen at a time, no problem.  But I can't upload JPG's.  I have not carefully mapped out exactly how large a JPG has to be before there's a problem, but I did successfully upload a couple of tiny ones.

In Media Gallery: Upload one JPG file, and when it gets to the end it just sits there with no response.  Upload using mass upload and it gets to the end of the first file and then just sits there.  The one file that was processed can be found sitting in the proper upload directory, but it's not listed in the Media Gallery database.  Once again, no problems with MP3, even files that are very large.

In SMF 2.0 RC1 forum it's basically the same thing.  I post a message and attach file(s).  The upload happens (can see my outbound firewall uploading the data) and then SMF goes to refresh the screen.  Screen goes blank and nothing happens.  The message is never entered into the database, but the first file that I attached is in the attachments directory.  MP3's work fine, even if they're 10x the size of the JPG's.

Pulling my hair out.  I'm guessing it's some change in PHP that my provider made, but I am not sure by looking at a PhpInfo.php file result if it's something there.

The usual culprits look OK.

upload_max_filesize   20M   20M

I've chmod'd the attachments directory, and the mgal_data directories and sub directories, to 755 and 777 with no change.

I've removed any .htaccess files that were in those directories.

What could have this effect on JPG files but not on MP3 files?
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

tfs

FUP, I have apparently crossed a threshold of JPG file thumbnail or preview generation.  I was able to upload progressively larger and larger JPG's (as forum message attachments) until I tried to jump from 655k to 817k.  Once I tried the 817k JPG I was met with the same blank screen problem as before.  I have not spent any more energy trying to nail down the exact size, or if it's related to file size or JPG dimensions, etc.

But I did discover that if I disable the display of JPG thumbnails in SMF, the problem goes away, at least in SMF forum posts, not in Media Gallery.

Here's an interesting experiment which apparently finds a bug in SMF RC1, pending attempts on other servers to repeat.

1) Disable the display of thumbnails in forum posts.
(admin/forum/attachments and avatars/attachment settings/)
Uncheck "Display image attachments as pictures under post"

2) In the forum, attach a huge JPG file to a post.  The one I had problems with is [2079x2600x16M], with a file size of  about 800k.  The file should attach OK.

3) Go back to admin and turn on the display of image attachments under posts.

4) Go to the forum and look at your message again.  On my system I get a blank page.

Is this a bug or a limitation of my server?  Since it also happens in Media Gallery I'm guessing it's a server limitation, but would appreciate knowing if it happens to anyone else.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Kindred

Please ask mod specific questions in the thread dedicated to supporting that mod (or, in this case, you could also ask on the smf media gallery support site)

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tfs

Quote from: Kindred on May 05, 2009, 05:40:52 PM
Please ask mod specific questions in the thread dedicated to supporting that mod (or, in this case, you could also ask on the smf media gallery support site)

If you read the thread you'll see that SMF 2.0 RC1 has the same problem, and I'm drawing a parallel between the problem as it exists in SMF Media Gallery and as it exists in SMF 2.0 RC1.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

H

tfs, do you still require help with this?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

tfs

Quote from: H on May 28, 2009, 09:19:31 AM
tfs, do you still require help with this?

As far as I know it's still broken.  I get around it by using smaller JPG's.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Aleksi "Lex" Kilpinen

The blank screen would suggest to me that you've hit a limit of somesort.
Probably a php timeout or similar. Do you have access to your server logs?
They might hold the answer on this.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

tfs

Quote from: LexArma on June 04, 2009, 03:36:49 AM
The blank screen would suggest to me that you've hit a limit of somesort.
Probably a php timeout or similar. Do you have access to your server logs?
They might hold the answer on this.

I agree that there's some limit reached regarding generating the preview and/or thumbnail, because it only happens with JPG's and not (even larger) MP3's.  It's shared hosting with 1and1.  I think I'd have to speak to one of their phone people to get info from the logs, which I'm loathe to do.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

karlbenson

It could be a memory issue with the generating of the thumbnails to go with the image.

I know I have already boosted it in the svn for RC2.

Sources/Subs-Graphics.php

FIND the line
   // Ask for more memory: we need it for this, and it'll only happen once!
Increase the amount of memory specified on the next line to something like 64M
   @ini_set('memory_limit', '64M');

Advertisement: