diff --git a/KenBurns/JBKenBurnsView.m b/KenBurns/JBKenBurnsView.m index 42fa9a1..52b2c1c 100755 --- a/KenBurns/JBKenBurnsView.m +++ b/KenBurns/JBKenBurnsView.m @@ -324,7 +324,7 @@ - (float)getResizeRatioFromImage:(UIImage *)image width:(float)frameWidth height { heightDiff = frameHeight - image.size.height; - if (widthDiff > heightDiff) + if (widthDiff < heightDiff) resizeRatio = frameWidth / image.size.width; else resizeRatio = self.bounds.size.height / image.size.height; @@ -350,7 +350,7 @@ - (float)getResizeRatioFromImage:(UIImage *)image width:(float)frameWidth height { heightDiff = frameHeight - image.size.height; - if (widthDiff > heightDiff) + if (widthDiff < heightDiff) resizeRatio = frameWidth / image.size.width; else resizeRatio = frameHeight / image.size.height;