Re: Using Imager module to resample images
- From: zentara <zentara@xxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 07:41:21 -0500
On Tue, 29 Jan 2008 03:08:11 -0800 (PST), Jason Carlton
<jwcarlton@xxxxxxxxx> wrote:
I've been forcing my visitors to resample their images manually to
keep them below 50kb, but this has only had so-so results. A lot of my
visitors don't understand how to resample their image, so I'm getting
high-resolution images that are something like 20px x 20px, but still
take up 50kb!
So, I've been thinking about resampling the images on the fly. The
images would be restricted to JPG, JPEG, GIF, and PNG.
I was planning to use a combination of Image::Resize and Imager, which
I've never used before, but since the load on the server is ALWAYS
high, I had a few questions first:
1. Will the use of Imager take up a lot of CPU resources?
Never noticed an excessive cpu usage, but check it yourself.
2. How do I recognize an animated GIF from a static GIF?
I believe it's safe to assume a static gif begins with GIF87, and
an animated with GIF89. But I'm not sure it's an absolute.
3. Does Imager compress JPG images automatically? I didn't see an
option to set a compression level in the docs, but it may be called
something else that I'm not recognizing.
4. I assume that I'll need to use Image::Resize to get the current
width and height, and if it exceeds the maximum that I input then I'll
use Imager to resample it. Is there a smarter (read: simpler and/or
less resource-heavy) option that this?
Your best bet is to read
perldoc Imager::Files for the jpegquality parameter
perldoc Imager::Transformations for converting and scaling
perldoc Imager::ImageTypes
perldoc Imager will give an overview
Also http://groups.google.com will have many examples.
Search for things like:
"perl Imager resize", etc
zentara
Jason
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
.
- Follow-Ups:
- Re: Using Imager module to resample images
- From: A. Sinan Unur
- Re: Using Imager module to resample images
- From: Abigail
- Re: Using Imager module to resample images
- References:
- Using Imager module to resample images
- From: Jason Carlton
- Using Imager module to resample images
- Prev by Date: Using Imager module to resample images
- Next by Date: FAQ 8.48 How do I add the directory my program lives in to the module/library search path?
- Previous by thread: Using Imager module to resample images
- Next by thread: Re: Using Imager module to resample images
- Index(es):
Relevant Pages
|
|