Author: agrundman
Date: Wed Nov 23 11:15:05 2011
New Revision: 33731
URL: http://svn.slimdevices.com/slim?rev=33731&view=rev
Log:
Fixed bug 17140, the code that switched to png for images resized to a different aspect ratio was missing from the newer resizing code, oops
Modified:
7.7/trunk/server/Changelog7.html
7.7/trunk/server/Slim/Utils/GDResizer.pm
Modified: 7.7/trunk/server/Changelog7.html
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Changelog7.html?rev=33731&r1=33730&r2=33731&view=diff
==============================================================================
--- 7.7/trunk/server/Changelog7.html (original)
+++ 7.7/trunk/server/Changelog7.html Wed Nov 23 11:15:05 2011
@@ -14,6 +14,7 @@
<li>Bug Fixes:</li>
<ul>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17140">#17140</a> - Non-square cover art thumbnails displayed with black borders</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17283">#17283</a> - Scanner can crash when renaming files and performing a rescan</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17459">#17459</a> - Rhapsody channels and radio are not scrobbled</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17639">#17639</a> - Rescan buttons scans the wrong folder</li>
Modified: 7.7/trunk/server/Slim/Utils/GDResizer.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Utils/GDResizer.pm?rev=33731&r1=33730&r2=33731&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Utils/GDResizer.pm (original)
+++ 7.7/trunk/server/Slim/Utils/GDResizer.pm Wed Nov 23 11:15:05 2011
@@ -125,7 +125,17 @@
main::idleStreams() unless main::RESIZER;
if ( $mode eq 'm' || $mode eq 'p' ) {
- $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height}\n";
+ # Bug 17140, switch to png if image will contain any padded space
+ if ( $format ne 'png' ) {
+ if ( $width && $in_width && ($in_height / $in_width) != ($height / $width) ) {
+ $format = 'png';
+ }
+ elsif ( $height && $in_height && ($in_width / $in_height) != ($width / $height) ) {
+ $format = 'png';
+ }
+ }
+
+ $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height} $format\n";
$im->resize( {
width => $width,
@@ -138,7 +148,7 @@
elsif ( $mode eq 'F' ) {
# Requested size is bigger than original -> return original size
if (( $width >= $in_width ) && ( $height >= $in_height)) {
- $debug && warn "Return original size ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height}\n";
+ $debug && warn "Return original size ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height} $format\n";
$im->resize( {
width => $in_width,
height => $in_height,
@@ -147,7 +157,7 @@
} );
# Requested size is smaller than original -> resize to requested size
} else {
- $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height}\n";
+ $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}x${height} $format\n";
$im->resize( {
width => $width,
height => $height,
@@ -158,7 +168,7 @@
}
else { # mode 'o', only use the width
- $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}xX\n";
+ $debug && warn "Resizing from ${in_width}x${in_height} $in_format @ ${offset} to ${width}xX $format\n";
$im->resize( {
width => $width,
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.