PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Pro Support Forums > Photopost Pro Installation & Upgrades

Photopost Pro Installation & Upgrades If you're having install or upgrade problems

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 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!
DesmondSweeney is offline   Reply With Quote
Old 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.
DesmondSweeney is offline   Reply With Quote
Old February 1st, 2006, 09:21 AM   #3 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
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.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old 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.
DesmondSweeney is offline   Reply With Quote
Old February 1st, 2006, 11:16 AM   #5 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
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.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old 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?
DesmondSweeney is offline   Reply With Quote
Old February 1st, 2006, 02:07 PM   #7 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
Once I have had enough time to test and evaluate all relatevant information on this yes I will respond.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old 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.
DesmondSweeney is offline   Reply With Quote
Old February 10th, 2006, 09:19 PM   #9 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
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.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old 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.
DesmondSweeney is offline   Reply With Quote
Old February 16th, 2006, 11:27 AM   #11 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
It is already in the new classifieds and the upcoming reviewpost release most likely Photopost will follow suit.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old February 20th, 2006, 09:52 AM   #12 (permalink)
Junior Member
Verified Customer
 
Join Date: Jan 2006
Posts: 19
Glad to hear it.

Thanks!
DesmondSweeney is offline   Reply With Quote
Old 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.
DesmondSweeney is offline   Reply With Quote
Old August 29th, 2006, 04:18 PM   #14 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
I do not show it in Photopost as of yet
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old September 22nd, 2006, 01:53 AM   #15 (permalink)
Member
Verified Customer
 
Join Date: Sep 2002
Posts: 225
Red face

Quote:
Originally Posted by Chuck S View Post
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?
CavySpirit is offline   Reply With Quote
Old September 22nd, 2006, 06:39 AM   #16 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,689
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);
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old 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.
CavySpirit is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Memory Error - Upload 2 or more files DesmondSweeney Photopost Pro Installation & Upgrades 1 January 31st, 2006 04:56 PM
Error memory(NOT A BUG) jlrios Photopost Pro Bug Reports 2 October 18th, 2005 01:36 PM
Fatal error: Allowed memory .....?? blifereal Photopost Pro Installation & Upgrades 2 March 31st, 2005 09:17 PM
Approve Photos - Memory Error Steve_C Photopost Pro Installation & Upgrades 2 March 23rd, 2005 10:29 AM


All times are GMT -5. The time now is 11:03 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0