Bug #27636 [Com]: imagecreatefromjpeg fails if the picture is too high
| From: | phpbugs at juracid dot co dot uk | Date: | Tue, 22 Nov 2016 23:51:22 +0000 |
| Subject: | Bug #27636 [Com]: imagecreatefromjpeg fails if the picture is too high | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205557@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=27636&edit=1
ID: 27636
Comment by: phpbugs at juracid dot co dot uk
Reported by: mito at nic dot fi
Summary: imagecreatefromjpeg fails if the picture is too high
Status: Closed
Type: Bug
Package: GD related
Operating System: FreeBSD 4.8-RELEASE #0
PHP Version: 4.3.4
Block user comment: N
Private report: N
New Comment:
For the confused, JPEGs are compressed, the image created by imagecreatefromjpeg() is a raw
(uncompressed) one so the size will be approximately width * height * 3
That's assuming 3 bytes / 24 bits per pixel, 8-bits for each of R,G,B, in reality using width *
height * 4 might be safer.
Previous Comments:
------------------------------------------------------------------------
[2004-03-18 14:54:22] mito at nic dot fi
Well, it does work on smaller pics so I guess it is the memory limit after all. I just wonder how a
smaller pic can take more memory..
------------------------------------------------------------------------
[2004-03-18 13:29:18] pajoye@php.net
Hello,
both work perfectly here. Either using cli, or apache, php5 or php4.
Please add the memory_limit option to your php.ini. Default is 8M, try more.
pierre
------------------------------------------------------------------------
[2004-03-18 13:25:56] mito at nic dot fi
Image that works:
Dimensions: 1600x1200
Size on disk: 575KB
Image that doesn't work:
Dimensions: 1200x1600
Size on disk: 491KB
------------------------------------------------------------------------
[2004-03-18 13:18:21] mito at nic dot fi
That is not the case. The test pic I provided that the code works with is larger than the pic that
causes the failure. Therefor if it were up to the picture being too large and using too much memory
it would occur with the larger picture too wouldn't it?
------------------------------------------------------------------------
[2004-03-18 12:29:37] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You probably have a memory_limit enabled and it is reached
trying to allocate memory to store a big image.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=27636
--
Edit this bug report at https://bugs.php.net/bug.php?id=27636&edit=1