NYCPHP Meetup

NYPHP.org

[nycphp-talk] inconsistency using "imagegif()": is there a workaround?

Dan Cech dcech at phpwerx.net
Fri May 7 20:51:07 EDT 2004


Phillip Powell wrote:
> re: http://us4.php.net/manual/en/function.imagegif.php
> 
> I have one class method that resizes images, including GIF images, and 
> works just fine doing so, even up to this line:
> 
> eval('image' . $extArray[$type] . '($newImage, "$tmpImageDownloadDir/" . 
> $this->fileName);');         // SAVE TO TEMPORARY IMAGE DIR FOR DOWNLOAD
> 
> THIS line produces the following error:
> 
> Fatal error: Call to undefined function: imagegif()

> Both work just fine for all other images (i.e., JPG, TIFF, PNG, SWF, 
> BMP, etc.)

Did you read the manual page you linked to?  GIF is not supported by all 
version of GD, and I'd be willing to bet yours doesn't support it, hence 
no imagegif function.

Also, using eval like that is just nasty, you should really be doing 
something more like the example code found on that page and at 
http://www.php.net/imagetypes

Dan



>From hans not junk at nyphp.com  Sat May  8 00:09:15 2004
Return-Path: <hans not junk at nyphp.com>
Received: from ehost011-1.intermedia.net (unknown [64.78.21.3])
	by virtu.nyphp.org (Postfix) with ESMTP id 45AA2A86E8
	for <talk at lists.nyphp.org>; Sat,  8 May 2004 00:09:15 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] Worst freelance offer of all time!
Date: Fri, 7 May 2004 21:09:07 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D2D at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] Worst freelance offer of all time!
Thread-Index: AcQyuHB4idBiQd7ISE6q7fxNJDqCjgB+XsZg
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Sat, 08 May 2004 04:09:15 -0000


> Well, at least it's not a full-time job in California paying=20
> $2-5k a year for LAMP  :)
>=20
> http://jobsearch.monster.com/getjob.asp?JobID=3D21235904
>=20
> 2,000.00 - 5,000.00 USD /year
> Salary Depends on Experience
>=20
> "Fast paced internet company seeks an adavnaced PHP=20
> programmer. Must have experience developing web applications=20
> using PHP and MySQL in a Linux environment.
>=20
> Candidate must show samples of work and knowledge of job skills.
>=20
> Salary will be based upon years of job experience and=20
> programming level."

That is quite disgusting.  I hope that all PHP developers snub their
nose at any such absurdity - otherwise, PHP has a very long way to go.

H


>From hans not junk at nyphp.com  Sat May  8 00:19:01 2004
Return-Path: <hans not junk at nyphp.com>
Received: from ehost011-1.intermedia.net (unknown [64.78.21.3])
	by virtu.nyphp.org (Postfix) with ESMTP id 863A3A85FE
	for <talk at lists.nyphp.org>; Sat,  8 May 2004 00:19:01 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] RE: [tcphp] Hella fun project I'm about to throw
	atsome tech col lege students
Date: Fri, 7 May 2004 21:18:58 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D2F at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] RE: [tcphp] Hella fun project I'm about to throw
	atsome tech col lege students
Thread-Index: AcQwrLFfLzyvidRMQYe3NVtQwLombwEBpIHA
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Sat, 08 May 2004 04:19:02 -0000


> Hi List.   A quick question.  I have some categories that are really
long
> and I would like to re-word or re-format them when I am bring=20
> data in from a DB.  Now which would be better:
>=20
> Do it with PHP
> or
> Do it with MySQL

This is probably a silly answer, but:

-- but if possible, do it in the DB.
-- otherwise, select all records from the DB, process in PHP, and reload
the DB.  Don't forget to lock the database if concurrency is a concern.

Sometimes string manipulation is too complex for any database.  But, if
possible, do the process in the DB with a function or two.  If things
get too sticky, then a real programming language like PHP is in order.

H

>=20
> Any suggestions as to how to?
>=20
> Example:
> A column name: Customer --> VARCHAR
> Values in Customer: "USA-North Upper ABVDFR Co. and Sons"=20
>=20
> I would like to re-word it for example: ABVDFR Co.
>=20
> I know I could use SUBSTRING or MID, or replace but the issue=20
> is since the column is a VARCHAR, the length of the value may=20
> change from row to row, for
> example: one row it maybe 20, in the next 13 and so on so=20
> forth.  I also thought that if I could use a length statement=20
> and come up with a formula...but so far no success....any suggestions?
>=20
> Thx in Adv.
>=20
> RS
>=20
>=20
> This e-mail, including attachments, may include confidential=20
> and/or proprietary information, and may be used only by the=20
> person or entity to which it is addressed. If the reader of=20
> this e-mail is not the intended recipient or his or her=20
> authorized agent, the reader is hereby notified that any=20
> dissemination, distribution or copying of this e-mail is=20
> prohibited. If you have received this e-mail in error, please=20
> notify the sender by replying to this message and delete this=20
> e-mail immediately.
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>=20
>=20

>From hans not junk at nyphp.com  Sat May  8 00:20:27 2004
Return-Path: <hans not junk at nyphp.com>
Received: from ehost011-1.intermedia.net (unknown [64.78.21.3])
	by virtu.nyphp.org (Postfix) with ESMTP id 3ED39A85FE
	for <talk at lists.nyphp.org>; Sat,  8 May 2004 00:20:27 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] Installing PEAR in FreeBSD
Date: Fri, 7 May 2004 21:20:24 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D30 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] Installing PEAR in FreeBSD
Thread-Index: AcQu+1kCGjExDCWjRuqwebfZCezruAFuE2BQ
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Sat, 08 May 2004 04:20:27 -0000


> Anyone has gotten PEAR installed in FreeBSD through the port system?
> I am getting an error saying that PHP is already installed. I=20
> have looked at some documents on installing it from scratch=20
> and doesn't seem terribly bad, but it would be so much better=20
> to do it from ports...

I've always done this by compiling from source, but maybe:

make reinstall

would help?  Maybe even a:

make deinstall

first, then a make install from the ports.

H




More information about the talk mailing list