Quote:
Originally Posted by alones
(in fact, I've fixed Phoney's function considering width and height).
...
Code:
CGFloat bytesPerRow;
if( thumbRect.size.width > thumbRect.size.height ) {
bytesPerRow = 4 * thumbRect.size.width;
} else {
bytesPerRow = 4 * thumbRect.size.height;
}
|
Alones, your fix is wrong. The bytesPerRow parameter is independent of aspect ratio. Even if the image is wider than it is tall, that doesn't affect the bytes per row. PhoneyDeveloper's original code is correct.