From 6d099bbe927a1dc3934c7b6254223961fc849453 Mon Sep 17 00:00:00 2001 From: Alexander Strange Date: Thu, 12 Feb 2004 02:58:55 +0000 Subject: [PATCH] "fixed image scaling" more like "broke aspect ratios" am i rite --- MainController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MainController.m b/MainController.m index eadc1b6..56f568f 100755 --- a/MainController.m +++ b/MainController.m @@ -812,9 +812,13 @@ static MainController *sharedController; } if ( [df boolForKey:@"showAlbumArtwork"] ) { + NSSize oldSize, newSize; NS_DURING - art = [[self currentRemote] currentSongAlbumArt]; - art = [[[[NSImage alloc] initWithData:[art TIFFRepresentation]] autorelease] imageScaledSmoothlyToSize:NSMakeSize(110,110)]; + art = [[self currentRemote] currentSongAlbumArt]; + oldSize = [art size]; + if (oldSize.width > oldSize.height) newSize = NSMakeSize(110,oldSize.height * (110.0f / oldSize.width)); + else newSize = NSMakeSize(oldSize.width * (110.0f / oldSize.height),110); + art = [[[[NSImage alloc] initWithData:[art TIFFRepresentation]] autorelease] imageScaledSmoothlyToSize:newSize]; NS_HANDLER [self networkError:localException]; NS_ENDHANDLER -- 2.20.1