On Fri, January 25, 2008 7:27 am, Eric Butera wrote: > I think the memory size can (sort of) be determined by width * height > * bits * channels / 8. I've never found anything better than that. > There are a few comments on the php site in the gd section about such > things but I've never seen it work 100%. I always set the real memory > limit much higher than what I say the max is for the memory size just > in case it gets an image that could break it. At least that stopped > the friendly white screens of death. :) > > If anyone has better ways of handling this I'd love to hear them. Don't try to do the thumb-nail in real-time for the user that uploads it. They already know what the image looks like. :-) Off-load that task to a separate cron job, run from CLI, which can use: php -q -d memory_limit 1000000000 thumbnail.php /path/to/image.jpg /path/to/thumbnails/ This way, you are not letting your HTTP php processes chew up more RAM than they really should, and you can give the thumbnail script a GIG (or more) of RAM to do whatever it needs to do. Run that job often enough, and the thumbnail will be available "fast enough" for the users who don't know what the image looks like. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php