473,569 Members | 2,799 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 2060
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_t ime 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
2607
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 install the scripts. I'm looking for an easier way to install the Python portion. I've been referred to:...
4
2314
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 deployment/distribution thing. I notice that the static library generates obj files and a Lib file. Could someone kindly explain how they relate to...
3
4254
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 active? Can the setting of LD_LIBRARY_PATH guanrantee that the correct one is executed? 2> In MS-WINDOWS, once a DLL is loaded by one...
8
3003
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 functions that are stored in a static library. During initialization of the executable, classes and static globals within functions linked from the...
34
2947
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 the executable ? Is it possible ? Also, how does the compiler add inling to the program ? I know that whenever it sees"inline" in front of the...
15
2272
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 lines in "somthing.c" implementation file into my source code?
6
30900
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 the file arapi51.dll to the system32 directory. However when I tried to access it I see this: Traceback (most recent call last):
13
16370
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 select a file), and this seems to be my stumbling block. When I try to run my program on another machine, it complains that comdlg32.ocx is not...
41
18113
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.