473,511 Members | 16,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where can I find the GD Library standalone executable file?

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.

However, I cannot find the standalone executable file that will ensure
I can run GD from the command line. Suggestions?

Thanx
Phil

May 18 '06 #1
4 2058
On Thu, 18 May 2006 15:10:20 -0700, comp.lang.php wrote:
However, I cannot find the standalone executable file that will ensure
I can run GD from the command line. Suggestions?


GD is a library, you don't run it, you link your executable with it.

$ rpm -ql gd-2.0.33-2
/usr/lib/libgd.so.2
/usr/lib/libgd.so.2.0.0
/usr/share/doc/gd-2.0.33
/usr/share/doc/gd-2.0.33/COPYING
/usr/share/doc/gd-2.0.33/README-JPEG.TXT
/usr/share/doc/gd-2.0.33/entities.html
/usr/share/doc/gd-2.0.33/index.html

As you can see, there is nothing to execute.

--
http://www.mgogala.com

May 19 '06 #2
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


May 19 '06 #3

Erwin Moller wrote:
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. :-)


Hey, that's what I'm doing now, although not as precisely as what you
have, however, it still runs out of memory, because while PHP increases
memory for itself, it resides on an active live server implementing
several other applications, thus, it either takes away memory from
another working application, or it never gets the extra memory it needs
because another application is using the memory up at the time, thus,
increasing memory doesn't always work in this case.

I was told by people at the DC PHP user's group that the best way to
debug this issue is to run GD from the command line (I read online as
well that this is possible, sorry for those who doubt, but supposedly
there's a Perl wrapper out there) to see if GD + PHP = too much memory
then GD + PHP - PHP = [how much memory?].

Phil

Good luck

Regards,
Erwin Moller

Thanx
Phil


May 19 '06 #4
NC
comp.lang.php wrote:

I am having memory timeout issues involving image
manipulation with extremely large images (800K - 2mb).
There is no such thing as a "memory timeout". You can have an
out-of-memory error (the script does not have enough memory to complete
what's required of it), or you can have a timeout (the script runs past
its allotted time). The former is controlled by memory_limit directive
in php.ini, the latter, by max_execution_time in php.ini and HTTP
server's timeout setting, whichever is shorter.

In your case, it apprears that you have an out-of-memory error. So
deal with it accordingly -- increase memory_limit. Note that you may
be able to do it from the script itself:

ini_set('memory_limit', '20M');
I cannot find the standalone executable file that will ensure
I can run GD from the command line.


There is no such file. GD is a library. If you want to access its
functionality from a command-line program, you need to write that
program or use a program someone else wrote. Check out Martin
Gleeson's fly:

http://martin.gleeson.com/fly/

Alternatively, you can install ImageMagick, which does include a
command-line executable...

Cheers,
NC

May 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2600
by: Sandeep Gupta | last post by:
Hi, I've written a commercial application that uses Python scripts for some of the functionality. Installing the Python portion of the application requires me to first install Python, and then...
4
2306
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a...
3
4246
by: K.S.Liang | last post by:
Hi all, 1> If there are more than one dynamic linking libraries in the file system, how do I know which one is loaded into system? Any C library or system call can tell me which *.so or *.sl is...
8
2997
by: Robert A Riedel | last post by:
I have an application that requires a DLL and an executable that uses the DLL, both of which were implemented in Visual C++ using unmanged code. Both the executable and the DLL are linked with...
34
2930
by: priyanka | last post by:
Hi, I was wondering if we could parse or do something in the executable( whose source language was C). How can I use some scripting language like perl/python to find out the information about...
15
2265
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the...
6
30895
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
13
16356
by: Wog George | last post by:
I need to create an EXE that is truly "standalone". By that, I mean the executable file is all that's required for the application to run. My app has a button that fires up a common control (to...
41
18064
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.