Skip Menu |

This queue is for tickets about the Image-Imlib2-Thumbnail CPAN distribution.

Report information
The Basics
Id: 48933
Status: resolved
Priority: 0/
Queue: Image-Imlib2-Thumbnail

People
Owner: Nobody in particular
Requestors: kane [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Make quality configurable
For some sizes, we're wanting higher quality than the default. The below patch makes quality configurable, while defaulting to 75 like the old code did: Index: /trunk/perl/5.10/lib/site_perl/5.10.0/Image/Imlib2/Thumbnail.pm ========================================================= ========== --- /trunk/perl/5.10/lib/site_perl/5.10.0/Image/Imlib2/Thumbnail.pm (revision 1539) +++ /trunk/perl/5.10/lib/site_perl/5.10.0/Image/Imlib2/Thumbnail.pm (revision 2561) @@ -99,4 +99,8 @@ $size->{type} ); next unless $type eq $original_type; + + ### XXX add quality from the size definition if provided -- 75 + ### is not a good fit for all sizes. + my $quality = $size->{'quality'} || 75; my $scaled_image; @@ -129,5 +133,5 @@ my $destination = file( $directory, "$name$ext" )->stringify; - $scaled_image->set_quality(75); + $scaled_image->set_quality( $quality ); $scaled_image->save($destination); push @thumbnails,
Thanks, this patch is in Image-Imlib2-Thumbnail-0.40.tar.gz which just hit CPAN.