andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


[ SOLVED ] Problem with big(ish) images

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Drop Shadowed Thumbnail Creator
View previous topic :: View next topic  
Author Message
quasipickle
Newbie


Joined: 21 Oct 2004
Posts: 6

PostPosted: Thu Oct 21, 2004 2:00 am    Post subject: [ SOLVED ] Problem with big(ish) images Reply with quote

Hi Andy (or amnuts, whichever you prefer),

First, I'll butter you up by saying you've created a great, easy-to-use, powerful class here. I'm using it both at work and at home. Now, on to my problem Smile :

This isn't related to code you've created, but rather to imagecreatefromjpeg(). The reason I'm asking you though, is because I've never run across this problem before. It boils down (I think - if I knew for sure I wouldn't be asking you) to a memory issue. When I try to call loadImage() on an uploaded file that's > ~300K, I get an out-of-memory error:
PHP wrote:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 6400 bytes) in /server/root/gallery/_drop_shadow/class.dropshadow.php on line 116

I have debugging statements on either immediate side of the
PHP:
<?php

$this
->_imgOrig $func($filename);

?>

statement - the statement before gets output, but not any after.

This doesn't happen when I run the function on a file < 300K, so I know I'm not running out of total memory on the server. Have you ever come across this problem before? If not, I apologize for boring you with irrelevant stuff.


Thanks a bunch.


Last edited by quasipickle on Thu Oct 21, 2004 6:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
quasipickle
Newbie


Joined: 21 Oct 2004
Posts: 6

PostPosted: Thu Oct 21, 2004 6:44 pm    Post subject: SOLVED Reply with quote

Hi,

Solved. I figured out there was a memory restriction set at 8M. I figured that would have been enough for a 300K file, but I was wrong evidently.

Thanks anyway.
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Sat Oct 23, 2004 7:20 am    Post subject: Reply with quote

Hi quasipickle, and welcome to the board!

I'm glad you got the issue resolved. It does sound like a huge amount of memory for a 300k file... When the image is created, it creates up to three images for the main picture; the original, the resized and the one with a dropshadow. Then it creates up to eight other images for the shadow components, all of which are really small. Even with all of these, the image memory consumption should be really small. Perhaps the version of GD you're using has some memory issues? I could try it out on my system with the same picture, if you want to email me it?

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
quasipickle
Newbie


Joined: 21 Oct 2004
Posts: 6

PostPosted: Mon Oct 25, 2004 10:16 am    Post subject: Reply with quote

Thanks for the offer, but I'm not convinced it's a really a bug problem. I was looking on some other forums and there was another fellow who was having the same problem I was having, but with only a 200K file. Many of the responses to his problem stated that GD uncompresses the JPG file, making it much bigger. Also, apparently GD uses a lot of memory itself, when goofing with pictures. So... it seems like this was more of an error in my knowledge, rather than a problem with my installation. Thanks again!
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Oct 26, 2004 5:29 am    Post subject: Reply with quote

Ahhh... That's good to know, thanks!

Perhaps when 'pimp' is on general release we'll have a really good, integrated image library for PHP (GD's good, but has limitations and flaws, as you've just mentioned).
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
quasipickle
Newbie


Joined: 21 Oct 2004
Posts: 6

PostPosted: Tue Oct 26, 2004 9:49 am    Post subject: Reply with quote

What's this 'pimp' you speak of? I've never heard of it. Is it another GD?
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Oct 26, 2004 10:37 am    Post subject: Reply with quote

It's not GD, but it is another imaging library (for PHP5). The website it used to be at doesn't seem to contain the information at the time of posting, but here it is anyway:

http://www.pearfr.org/pimp/

also see:

http://blog.coggeshall.org/archives/86_Back_from_the_Int._PHP_Conference.html

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Drop Shadowed Thumbnail Creator All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group