RE: [PHP] Beveled text

This is a discussion on RE: [PHP] Beveled text within the PHP General forums, part of the PHP Programming Forums category; Ok, that's reasonable. My only suggestion would be to cache the images that your script generates. A good way ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-09-2003
Javier Muniz
 
Posts: n/a
Default RE: [PHP] Beveled text

Ok, that's reasonable. My only suggestion would be to cache the images that
your script generates. A good way to do this is to md5 or otherwise hash
the arguments to the PNG generation code and then have the code search for a
file in a specified directory (/tmp/generated_pngs for instance) with that
name before calling gd, if it exists just read out that file, otherwise
generate a new one and place it in the directory. This will lower your
overhead without adding too much complexity. To spray out the cached
version of your PNG use readfile() or something similar.

-Javier

-----Original Message-----
From: Ashley M. Kirchner [mailto:ashley@pcraft.com]
Sent: Saturday, November 08, 2003 11:57 PM
To: Javier Muniz
Cc: php-general@lists.php.net
Subject: Re: [php] Beveled text


Javier Muniz wrote:

>Interesting, is this for a website? If so have you tried doing the
>same thing with CSS? Using CSS you could make the site load faster and
>be more accessible (for instance, you can allow users to choose their
>own font size, and make it easier for page readers to handle your
>page).
>

When I originally created the script, it was simply an exercise, to
see if I could do it. However, I have since then incorporated it into a
site design of mine, where I wanted the headers to be images,
dynamically created. So yes, for each page that loads, each header
calls this script which then spits out the PNG data. Large overhead,
simply because I never bothered looking into doing it with CSS, and also
because outputting a PNG image I'm guaranteed it will work, and it will
look the way I want it to look (both font type, as well as with layout
positioning,) as opposed to dealing with broken browsers and people not
seeing the same thing. And also because I can use my fonts, instead of
relying on the user having a particular font installed on their system.

--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley@pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0