News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Resize Attached Images (Updated for 2.0 RC4)

Started by Kays, October 17, 2009, 04:19:10 PM

Previous topic - Next topic

Kays

Quote
I did migrate from one host to another moving all files with Filezilla. I did not know then that i had to set Filezilla to transfer files without a file extension (eg .jpg) as binary files and after moving the site that was 2.0 RC4 everything worked.

If that's the case, that could be the problem. Try adding an extension to a file from your backup and see if it's viewable as an image. If that's the case you should be able to just re-upload them as binary this time.

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

perestroika

Quote from: Kays on October 04, 2011, 11:41:52 AM
Quote
I did migrate from one host to another moving all files with Filezilla. I did not know then that i had to set Filezilla to transfer files without a file extension (eg .jpg) as binary files and after moving the site that was 2.0 RC4 everything worked.

If that's the case, that could be the problem. Try adding an extension to a file from your backup and see if it's viewable as an image. If that's the case you should be able to just re-upload them as binary this time.

I did however select binary as the default transfer type before transferring the files to the server but i didn't uncheck the "Treat files without extension as ASCII file". If I transfer files from the web server back to my PC they all seem viewable on my PC so I'm not sure that's my problem. Besides my problem may be isolated to a single topic, that is, I haven't found the same problem in other threads. It might just be a coincidense that the "problem topic" is full of images. The problem i experience could actually be any kind of problem with SMS or maybe corrupt data in DB. Who knows  ::) I think I will experiment a bit with splitting the topic into several and back again... If nothing else helps I will have to just delete that topic and hope it´s only one topic that's affected. Thanks Kay, You have been more than helpful!

Kays

Can you open one of the problem files to view it. If so, Maybe it's just the thumbnails which are corrupt.

One thing you could try in this case, is to change the size of the thumbnails. Then all thumbnails will be recreated on the fly as they are viewed.

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

perestroika

Quote from: Kays on October 04, 2011, 01:30:43 PM
Can you open one of the problem files to view it. If so, Maybe it's just the thumbnails which are corrupt.

One thing you could try in this case, is to change the size of the thumbnails. Then all thumbnails will be recreated on the fly as they are viewed.

Hi Kays!

Changing thumbnail size doesn't solve the problem.

By not displaying thumbnails i can see the faulty postings and I've isolated one for testing. It is indeed a posting with an image attached. I've found the attachment in the DB.

id_attach id_thumb id_msg id_member attachment_type filename size downloads width height file_hash fileext mime_type id_folder approved
10102 10103 52192 0 0 Thailand juni-juli 2011 071.jpg 2729415 1 4000 3000 XXXX7943a41b3d65e88812e24b2aaab3f84c9219 jpg image/jpeg 1 1
10103 0 52192 0 3 Thailand juni-juli 2011 071.jpg_thumb 436971 0 640 480 XXXXa9cfdd705d31a215afb41fbc4cab95e64040 jpg image/png 1 1


Further I've found them in the attachments folder.
There is actually 3 files, all the same size (2729415 bytes)
10102_XXXX7943a41b3d65e88812e24b2aaab3f84c9219
10102_XXXX7943a41b3d65e88812e24b2aaab3f84c9219.temp
10102_XXXX7943a41b3d65e88812e24b2aaab3f84c9219_thumb.tmp


And the thumbnail
10103_XXXXa9cfdd705d31a215afb41fbc4cab95e64040

I can open all the files if i transfer them to my pc.
If I delete the temp files one of them is recreated, but it still doesn't solve the problem. Still a WSOD blank page.

I attach the photo here that caused the problem. I think I'm getting closer to a solution.  ;)



perestroika

Hello again.
The problem I described in previous postings is indeed not a problem with the mod. It's a Memory limit error resizing large attachments. The problem is a combination of SMF 2.0.1 and my Host provider limiting the memory php uses to 64MB.

Everything is described here (They say it's fixed but it's obviously not)

http://www.simplemachines.org/community/index.php?topic=345724.0
http://dev.simplemachines.org/mantis/view.php?id=4234
http://dev.simplemachines.org/mantis/view.php?id=2229

Thanks Kays for helping me!  :)

Kays

The memory thing has been resolved. When I reported it, it was in the wrong function. It has been moved to the proper function and increased from 90 to something like 120, I think it was.

Any chance of you using a custom php.ini file and increasing the value there?

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

perestroika

Memory is limited by the web hosting services company to maximum 64MB.  :'( There is nothing i can do to increase it.

perestroika

Quote from: perestroika on October 05, 2011, 09:03:45 AM
Memory is limited by the web hosting services company to maximum 64MB.  :'( There is nothing i can do to increase it.

The web hosting company changed the limit to 92 MB (according to phpinfo()). Everything works now!  :) :) :)

Kays


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

computerworks

We posted about this issue last year, but have yet to find a solution

http://www.simplemachines.org/community/index.php?topic=342947.msg2659054#msg2659054

Frequently, an attached image shows with a thumbnail of a very small file size (8k) and, when clicked, opens to a large totally black image.

Strangely, in posts with several attachments, maybe only one attachment experiences this, while the others are OK.

Using V.1.5 of the Mod, SMF 1.1.11 and the Default template.

Any help would be appreciated...thanks

Kays


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


Kays

Are they actually jpegs?

Does this happen to the same file if you re-upload it?

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

computerworks

I will track down a user who has a bad attachment as described and will try to re-upload.

(may take a day)

Thanks for following this.  ;)

computerworks

It might be worth noting that it has been reported to me that resized attachments that have been viewable for several days may suddenly stop expanding and only yield the full black image when clicked.

Kays

Quote from: computerworks on December 02, 2011, 05:28:16 PM
I will track down a user who has a bad attachment as described and will try to re-upload.

If it is just one or a few images, could you attach it here so I can have a look at it?

Quote from: computerworks on December 02, 2011, 05:29:53 PM
It might be worth noting that it has been reported to me that resized attachments that have been viewable for several days may suddenly stop expanding and only yield the full black image when clicked.

It should only get resized once. Are you also using an image display mod like the highslide viewer?


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

computerworks

Quote from: Kays on December 02, 2011, 05:36:20 PM
If it is just one or a few images, could you attach it here so I can have a look at it?

attached


Quote
It should only get resized once. Are you also using an image display mod like the highslide viewer?

No.

computerworks

Original image is gone...it was larger in file size and contained correct image.

The attached is how the post's attachment thumbnail now appears.

Kays

There's gotta be something funky about that image if it does it here also. ???

Can you zip it and attach it?

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

bwaynef

#179
I uploaded a file that was 840kb and much larger than 800x600 and this mod seemed to resize it fine. 

When I take an image that's straight off the camera, 5+MB, I get:

"An Error Has Occurred!
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.

Please consult your server administrator for more information. "

php.ini has: "upload_max_filesize = 8M" ,
Max attachment size per post:    6144KB
Max size per attachment:    256KB


Any help here?

Advertisement: