 | |  | | | Photopost Pro Installation & Upgrades If you're having install or upgrade problems |
January 31st, 2006, 04:53 PM
|
#1 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
| PHP + GD memory error
Hello Everyone,
I was experencing an error similar to the following:
Allowed memory size of n bytes exhausted (tried to allocate n bytes) in script.php
After reading these forums and google, it's clear this isn't a bug with photopost so much as it is a limitation of GD and PHP (GD being inefficient, and PHP terminating poorly when there isn't enough memory).
My fix was to add a dynamic 'memory required' check to uploadphoto.php and bulkupload.php. I searched for the function call 'create_thumb', and added a check similar to the following: Code: Content visible to verified customers only.
What the above script does is checks the current image memory requirements (based on the formula) against the maximum available php memory. If there's enough memory to process, it does, if not, it deletes the file and moves on.
What I'm not sure of is if I'm breaking anything when I do this. I'm more than happy to post my modified files if that'd help you determine if i've done the right thing here.
Comments?
Photopost staff: can you work this into a service release or into the next version? Ideally PhotoPost should *never* just flake out, errors should be handled wherever possible.
Thanks in advance!
|
| |
February 1st, 2006, 09:14 AM
|
#2 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
*BUMP*
Here's the two modified files (inside the zip). Could one of the PhotoPost staff members please take a peak? All code i added has 'Desmond' in comments surrounding it.
Thanks!
Last edited by Chuck S; February 1st, 2006 at 09:19 AM.
|
| |
February 1st, 2006, 09:21 AM
|
#3 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
I have removed your attachment but I downloaded it to look at.
Sorry it is never allowed the attaching of our full script php files in any forum not even our own. As with any commercial product you are permissable to upload modified template files etc but never the scripts themselves.
Thanks I will look into this memory check feature.
|
| |
February 1st, 2006, 10:24 AM
|
#4 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
Sorry! I assumed that because only verified customers can get downloads, it'd be OK.
Thanks for your assistance, I look forward to your feedback.
|
| |
February 1st, 2006, 11:16 AM
|
#5 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
Not a problem no harm no foul.
Even in the modifications forum users are not allowed to post full modified PHP scripts of our code. It is like this with most commercial apps.
We shall check out this posted function and test the ramifications and security concerns etc.
|
| |
February 1st, 2006, 12:41 PM
|
#6 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
Excellent. Will you post back here when you're done?
|
| |
February 1st, 2006, 02:07 PM
|
#7 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
Once I have had enough time to test and evaluate all relatevant information on this yes I will respond. |
| |
February 2nd, 2006, 10:57 AM
|
#8 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
I look forward to it. Thanks so much.
|
| |
February 10th, 2006, 09:19 PM
|
#9 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
Well this should work from what I see. I trimmed things down a bit to all that was needed since we already call getimagesize. GD calls resize_jpeg function to create the images so here is all you need to add in bold. Code: Content visible to verified customers only.
|
| |
February 16th, 2006, 11:11 AM
|
#10 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
Thanks for looking at that for me.
Will this 'fix' make it into your next release?
Desmond.
|
| |
February 16th, 2006, 11:27 AM
|
#11 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
It is already in the new classifieds and the upcoming reviewpost release most likely Photopost will follow suit.
|
| |
February 20th, 2006, 09:52 AM
|
#12 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
Glad to hear it.
Thanks!
|
| |
August 29th, 2006, 02:52 PM
|
#13 (permalink)
| | Junior Member Verified Customer
Join Date: Jan 2006
Posts: 19
|
Hello,
Was this added to the latest Photopost version?
Thanks!
Desmond.
|
| |
August 29th, 2006, 04:18 PM
|
#14 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
I do not show it in Photopost as of yet
|
| |
September 22nd, 2006, 01:53 AM
|
#15 (permalink)
| | Member Verified Customer
Join Date: Sep 2002
Posts: 225
| Quote:
Originally Posted by Chuck S Well this should work from what I see. I trimmed things down a bit to all that was needed since we already call getimagesize. GD calls resize_jpeg function to create the images so here is all you need to add in bold. Code: Content visible to verified customers only.
| I thought I had the latest version of Classifieds and I'm not seeing this code and I think I'm having this same issue. Help?
|
| |
September 22nd, 2006, 06:39 AM
|
#16 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
This code is NON WORKABLE with newer PHP's
You want to simple place something lke this in your pp-inc.php file near the error_reporting line
ini_set("memory_limit", "40M);
|
| |
September 22nd, 2006, 10:48 AM
|
#17 (permalink)
| | Member Verified Customer
Join Date: Sep 2002
Posts: 225
|
Thanks. Discovered it doesn't work. I think I got it working--my memory issue, that is.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 11:32 AM. | |