agens-no/AGGeometryKit

AGTransformPixelMapper does not work with padded images

proxi opened this issue · 1 comments

AGTransformPixelMapper assumes that bytesPerRow == 4 * width. This frequently isn't the case - CGImages are often padded for 16byte alignment. For example, 300x150 UIImage captured with UIGraphicsGetImageFromCurrentImageContext has row width of 1216. Thus, CGImageGetBytesPerRow should be used to determine alignment of input bitmap.

Great! I was thinking this could potentially be an issue.. Thanks a lot!