By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

"On the fly" images

P: n/a
I have a web page/script that displays image files residing on disk. I
do not know what size they are (in pixels), so I want to be able to
resize an image if it is bigger than the limit I allow (say, 900 pixels
wide).

I want to create the resized image in memory and serve it directly,
without saving the resized image to disk (they are only temporary, and
I'd rather not worry about cleanup). I know how to use some of the GD
library and I also know how to use ImageMagick. I would prefer to use
ImageMagick, as it has a good quality Unsharp mask (usually needed after
a resize/resample of an image), but I don't know if it is capable of
doing this (creating the image in memory so I can serve it directly
without saving it to disk first).

Using the GD library, I need only use a header to set the MIME type and
then imagejpeg to serve the resized image directly from memory.

Does anyone happen to know if I can I accomplish the same thing with
ImageMagick?

Also, ... does anyone know of any good tutorials or scripts for
on-the-fly image editing (ImageMagick or GD lib)? (This is a pretty
good one: <http://codewalkers.com/tutorials/42/1.html Any others? Any
that use ImageMagick?)

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Jul 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Message-ID: <JI******************************@comcast.comfro m Chuck
Anderson contained the following:
>I want to create the resized image in memory and serve it directly,
without saving the resized image to disk (they are only temporary, and
I'd rather not worry about cleanup). I know how to use some of the GD
library and I also know how to use ImageMagick. I would prefer to use
ImageMagick, as it has a good quality Unsharp mask (usually needed after
a resize/resample of an image), but I don't know if it is capable of
doing this (creating the image in memory so I can serve it directly
without saving it to disk first).
If you are going to use the image again, or someone else might, it is
better to save it. There are various custom unsharp mask functions
available for the GD functions if you don't have Imagemagick available
but tend to be a bit slow.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 6 '06 #2

P: n/a
Geoff Berrow wrote:
Message-ID: <JI******************************@comcast.comfro m Chuck
Anderson contained the following:
>I want to create the resized image in memory and serve it directly,
without saving the resized image to disk (they are only temporary, and
I'd rather not worry about cleanup). I know how to use some of the GD
library and I also know how to use ImageMagick. I would prefer to use
ImageMagick, as it has a good quality Unsharp mask (usually needed after
a resize/resample of an image), but I don't know if it is capable of
doing this (creating the image in memory so I can serve it directly
without saving it to disk first).

If you are going to use the image again, or someone else might, it is
better to save it. There are various custom unsharp mask functions
available for the GD functions if you don't have Imagemagick available
but tend to be a bit slow.
There is a cgi script called gd-imager that allows you to resize your
images by passing the height and width on the url. You can find the
program here

http://www.rejump.com/gd_imager/
Jul 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.