|
Posted by Erwin Moller on 05/19/06 13:48
comp.lang.php wrote:
> I downloaded the tarball and while was able to compile within PHP with
> no problems, I am having memory timeout issues involving image
> manipulation with extremely large images (800K - 2mb). Requirements
> are to create thumbnails for even these banner-sized images, but PHP +
> GD + [huge image] = too much memory.
>
> I'm trying to prove that it is undoable, though the suggestion was to
> do a command-line GD call to the image instead of using the PHP
> functions to do so to save some memory; if it still times out, then
> it's undoable altogether.
>
Hi Phil,
Both the timeout- and the memoryissue are relative.
You can adjust them to your own liking.
This can be done by via php.ini or via ini_set() above your script.
Just browse through php.ini and look for the timeoutsettings
(max_execution_time) for a script and max_memorysize (memory_limit).
Read more here:
http://nl3.php.net/manual/en/function.ini-set.php
and
http://nl3.php.net/manual/en/ini.php#ini.list
> However, I cannot find the standalone executable file that will ensure
> I can run GD from the command line. Suggestions?
As far as I know, you never call the GD libs directly.
(But maybe somebody wrote a wrapper, not sure, why not use PHP as wrapper?
It has many nice functions.)
One more note on the memory-issue:
If you have a jpg file of say: 100 KB with dimensions of 1000 X 400 pixels ,
and the file is represented as 24-bit in memory, PHP (and any language)
needs a LOT more than 100KB to store it.
You can easily estimate the memory needed: width X heigth X 3 bytes, so that
will be 1.200.000 Bytes for an 1000x400 image.
Just increase the memory needed and the time your scripts needs.
I think that is by far the easiest solution. :-)
Good luck
Regards,
Erwin Moller
>
> Thanx
> Phil
Navigation:
[Reply to this message]
|