Hi everyone,
this is one of those "inherited from someone else" projects that I'm having
problems with and was wondering if someone could help me out.
Our setup:
Redhat Linux
Apache 2.0.46
PHP 4.3.2
GD 1.8.4
We have a php-based setup that allows users to upload images and then some
back-end stuff that stores the original image and creates a thumbnail image.
I've just noticed that large images, say 1500x1500 or larger, give the
resize script some problems. We're using Shiege Iseng's resize class
(http://kentung.f2o.org/scripts/thumbnail/).
The error is coming when the class calls the imagecreatefrom jpeg() function,
and the specific error is
Fatal error: Allowed memory size of 29360128 bytes exhausted (tried to
allocate 8652 bytes) in <servername>/resize.php on line 51
The image itself is 2163x2957x24bpp at 300 dpi and is 3 megs on disk and
18.31 MB in memory, according to IrfanView.
If I use IrfanView to reduce the image to, say, 1400x1800 or so then the
resize script has no problems, so I guess there really IS a memory issue.
;-)
I'm wondering:
1. will the problem go away if I upgrade to GD 2.x?
2. will the problem go away if I upgrade to PHP 5?
It's doubtful that I'll be able to upgrade PHP or GD, though ...
So, first of all, has anyone run into a problem like this? Second, what are
my options? One big constraint is that the preferred solution is to let
users upload images to whatever size they want, so setting a 1500x1500
restriction before they upload isn't going to work.
Thanks!
this is one of those "inherited from someone else" projects that I'm having
problems with and was wondering if someone could help me out.
Our setup:
Redhat Linux
Apache 2.0.46
PHP 4.3.2
GD 1.8.4
We have a php-based setup that allows users to upload images and then some
back-end stuff that stores the original image and creates a thumbnail image.
I've just noticed that large images, say 1500x1500 or larger, give the
resize script some problems. We're using Shiege Iseng's resize class
(http://kentung.f2o.org/scripts/thumbnail/).
The error is coming when the class calls the imagecreatefrom jpeg() function,
and the specific error is
Fatal error: Allowed memory size of 29360128 bytes exhausted (tried to
allocate 8652 bytes) in <servername>/resize.php on line 51
The image itself is 2163x2957x24bpp at 300 dpi and is 3 megs on disk and
18.31 MB in memory, according to IrfanView.
If I use IrfanView to reduce the image to, say, 1400x1800 or so then the
resize script has no problems, so I guess there really IS a memory issue.
;-)
I'm wondering:
1. will the problem go away if I upgrade to GD 2.x?
2. will the problem go away if I upgrade to PHP 5?
It's doubtful that I'll be able to upgrade PHP or GD, though ...
So, first of all, has anyone run into a problem like this? Second, what are
my options? One big constraint is that the preferred solution is to let
users upload images to whatever size they want, so setting a 1500x1500
restriction before they upload isn't going to work.
Thanks!
Comment