CB-7551 - [Camera][iOS 8] Scaled images show a white line

Signed-off-by: Shazron Abdullah <shazron@apache.org>
This commit is contained in:
ktsour 2014-09-15 19:00:45 +03:00 committed by Shazron Abdullah
parent 513bfde49e
commit 3581c595d7

View File

@ -532,6 +532,10 @@ static NSSet* org_apache_cordova_validArrowDirections;
scaledSize = CGSizeMake(MIN(width * scaleFactor, targetWidth), MIN(height * scaleFactor, targetHeight));
}
// If the pixels are floats, it causes a white line in iOS8 and probably other versions too
scaledSize.width = (int)scaledSize.width;
scaledSize.height = (int)scaledSize.height;
UIGraphicsBeginImageContext(scaledSize); // this will resize
[sourceImage drawInRect:CGRectMake(0, 0, scaledSize.width, scaledSize.height)];