Ok, I just wrote some functions last night for a few people, I posted them
up for whom ever wants it (free) http://www.gzentools.com/gzimg.php
It is simple a way to spit out thumbs, or resized images, and to cache the
image so it doesnt have to be rebuilt.
Nothing fancy, but it could help a few people out.
--
Mike Bradley http://www.gzentools.com -- free online php tools 8 2790
Nice. I think we make better use of the client cache though, by redirecting
to the generated image. As it is, the browser has to refetch the image
everytime.
Uzytkownik "CountScubula" <me@scantek.hotmail.com> napisal w wiadomosci
news:5F******************@newssvr25.news.prodigy.c om... Ok, I just wrote some functions last night for a few people, I posted them up for whom ever wants it (free)
http://www.gzentools.com/gzimg.php
It is simple a way to spit out thumbs, or resized images, and to cache the image so it doesnt have to be rebuilt.
Nothing fancy, but it could help a few people out.
-- Mike Bradley http://www.gzentools.com -- free online php tools
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:iI********************@comcast.com... Nice. I think we make better use of the client cache though, by
redirecting to the generated image. As it is, the browser has to refetch the image everytime.
Thank you,
Hmm, sounds interesting, you mean have a cache dir that is in the web server
view, and do a Location: bla.... to point to the image?
Hmm I will have to play and see, becouse as it is, if there is any change
int he source image, there is a new image generated.
also, I just added a few more functions:
title - add a caption
pan - show part of image
zoom - show a zoomed from middle portion
tile - tile the image
--
Mike Bradley http://www.gzentools.com -- free online php tools
Regarding this well-known quote, often attributed to CountScubula's famous
"Sat, 24 Jan 2004 01:48:37 GMT" speech: "Chung Leong" <ch***********@hotmail.com> wrote in message news:iI********************@comcast.com... Nice. I think we make better use of the client cache though, by redirecting to the generated image. As it is, the browser has to refetch the image everytime.
Thank you,
Hmm, sounds interesting, you mean have a cache dir that is in the web server view, and do a Location: bla.... to point to the image?
Hmm I will have to play and see, becouse as it is, if there is any change int he source image, there is a new image generated.
also, I just added a few more functions:
title - add a caption pan - show part of image zoom - show a zoomed from middle portion tile - tile the image
Just title the cached image uniquely --
something like:
[PATH-HASH]_[MOD-DATE].ext
where [PATH-HASH] is the full original path, run through something (md5 or
a search-replace) to purge evil chars, and [MOD-DATE] is the file's
last-modified date. When the code is run, do something like:
1.) Get all filenames containing [PATH-HASH] in the cache directory
2.) Is the latest [MOD-DATE] the same as the real file's modified-stamp?
3. Yes) Do not recreate the thumbnail. Redirect to the cached version.
3. No) Delete (unlink) all files with [PATH-HASH]_*
4. No) Create a new thumbnail, and redirect to it.
--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
"FLEB" <so*********@mmers.and.evil.ones.will.bow-down-to.us> wrote in
message news:1p******************************@40tude.net.. . Regarding this well-known quote, often attributed to CountScubula's famous "Sat, 24 Jan 2004 01:48:37 GMT" speech:
1.) Get all filenames containing [PATH-HASH] in the cache directory 2.) Is the latest [MOD-DATE] the same as the real file's modified-stamp?
3. Yes) Do not recreate the thumbnail. Redirect to the cached version.
3. No) Delete (unlink) all files with [PATH-HASH]_* 4. No) Create a new thumbnail, and redirect to it.
-- -- Rudy Fleminger -- sp@mmers.and.evil.ones.will.bow-down-to.us (put "Hey!" in the Subject line for priority processing!) -- http://www.pixelsaredead.com
the images are already cached and uniq named, Leong was talking about
redirecting rather than readfile. look at the script and you will
understand.
--
Mike Bradley http://www.gzentools.com -- free online php tools
Yup, let Apache send the image, since it's pretty good at dealing with the
nitty gritty of HTTP transport (caching, validation, partial retrieval,
etc.). Also saves a trip into the PHP output buffer.
I guess you can implement it in a different set of functions, so that you
would retain the ability to send the file via PHP, in cases where you want
to control access to the images.
One more suggestion: before calling readfile(), do a session_write_close()
to remove the session lock if a session is opened.
Uzytkownik "CountScubula" <me@scantek.hotmail.com> napisal w wiadomosci
news:V9******************@newssvr25.news.prodigy.c om... "Chung Leong" <ch***********@hotmail.com> wrote in message news:iI********************@comcast.com... Hmm, sounds interesting, you mean have a cache dir that is in the web
server view, and do a Location: bla.... to point to the image?
Hmm I will have to play and see, becouse as it is, if there is any change int he source image, there is a new image generated.
also, I just added a few more functions:
title - add a caption pan - show part of image zoom - show a zoomed from middle portion tile - tile the image -- Mike Bradley http://www.gzentools.com -- free online php tools
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:7o********************@comcast.com... Yup, let Apache send the image, since it's pretty good at dealing with the nitty gritty of HTTP transport (caching, validation, partial retrieval, etc.). Also saves a trip into the PHP output buffer.
Working on it as we converse, will be in ver 1.5, I added a few things check
it out.
One more suggestion: before calling readfile(), do a session_write_close() to remove the session lock if a session is opened.
Please explain, can you elaborate?
--
Mike Bradley http://www.gzentools.com -- free online php tools
CountScubula wrote: "Chung Leong" <ch***********@hotmail.com> wrote in message news:7o********************@comcast.com...
Yup, let Apache send the image, since it's pretty good at dealing with the nitty gritty of HTTP transport (caching, validation, partial retrieval, etc.). Also saves a trip into the PHP output buffer.
Working on it as we converse, will be in ver 1.5, I added a few things check it out.
One more suggestion: before calling readfile(), do a session_write_close() to remove the session lock if a session is opened.
Please explain, can you elaborate?
-- Mike Bradley http://www.gzentools.com -- free online php tools
I dig this:
gzImageSetCacheDir(dir[,url]);
That's hot.
- Dan http://www.dantripp.com/
Two PHP scripts cannot access the same session simultaneously. If the
browser tries to download two images concurrently, and a session is opened
(say, if auto session is used), one of them will stall until the other is
done, unless you release the session with a call to session_write_close().
Uzytkownik "CountScubula" <me@scantek.hotmail.com> napisal w wiadomosci
news:LA*****************@newssvr29.news.prodigy.co m... "Chung Leong" <ch***********@hotmail.com> wrote in message news:7o********************@comcast.com... Yup, let Apache send the image, since it's pretty good at dealing with
the nitty gritty of HTTP transport (caching, validation, partial retrieval, etc.). Also saves a trip into the PHP output buffer.
Working on it as we converse, will be in ver 1.5, I added a few things
check it out.
One more suggestion: before calling readfile(), do a
session_write_close() to remove the session lock if a session is opened.
Please explain, can you elaborate?
-- Mike Bradley http://www.gzentools.com -- free online php tools
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Perttu Pulkkinen |
last post by:
I use database to store images. So img-tags are like
<img src="viewer.php?img_id=100">
Can I use javascript/php-combination to preload images of whole site after
first page is loaded? Or does...
|
by: K |
last post by:
I have found a script online that I want to use (I am new to PHP).
It creates dynamic images based on the text that you pass it.
However, no matter how I try, I can't get anything other than a...
|
by: Travis Pupkin |
last post by:
Hey,
I've done a number of product catalogs/galleries with one or two
category levels (Category > Subcategory). The straightforward way to do
this, of course, is to use database fields for...
|
by: JOSEPHINE ALVAREZ |
last post by:
I have this code that I want to use to do a rollover. However, because the
company I am doing it for is continually changing the text, I want to be
able to use dynamic text to change the text on...
|
by: Ken Varn |
last post by:
I have an ASP.NET page that draws over 32 dynamic images using an HttpModule
object through the <IMG> tag. Since IIS under Win2K Pro has a limit of 10
connections, some of the images do not get...
| |
by: NateDawg |
last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if
anyone has some input it would sure help me out.
Ok, I’ve noticed a few gridview problems floating around the forum....
|
by: richardgroen |
last post by:
Hi all,
I got one brainteaser (well...for me).
I have a database with, lets say 100 images, these images are 'dynamic' e.g. it can be 100 but also 151 images.
My question is:
How can i...
|
by: sumaiya |
last post by:
I have bought a flash template and hve made it dynamic ie it has dynamic text but now i want to have dynamic images as well. The code that I have for the same is working but whn i use it in the...
|
by: javasachin |
last post by:
Dear Friends,
I have a requirement like this:
In my JSP Page, I want to display some dynamic Arrow Images. While clicking on each of these Arrow Images, I want them to expand and create some...
|
by: =?Utf-8?B?UiBSZXllcw==?= |
last post by:
Hi!
This discussion may help other programmers get a better idea of how to save
uploaded images through a website.
Why? Well currently, I save 3 versions of every uploaded image on my own...
|
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,...
| |
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |