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,