Yes, sorry, I was lazy in my answer. I meant that this whole thing seemed too much trouble. It seems that by setting the proportion fixed (fixing the w/h ratio) I can generate the image only once on the server and the resize with CSS and JS.

Thanks for pointing this out though.
 

On 10/24/06, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
> If the image name had the dimensions I could check if that particular
> image was already generated, but it looks like too much trouble.

That's what this code does:

    my $key = join(":", $width, $height, $image );
    my $scaled = $cache->get($key);
    unless ( defined $scaled ) { ... $scaled = scale_the_image() ... }

If the image was in cache, the unless(){} block is skipped, and the
cached version is stored.  If the image wasn't in cache, it's scaled and
then stored in the cache.  The $c->cache handles expiration, elimination
of duplicate entries, etc.

Regards,
Jonathan Rockway

--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to