Yep, I see the CGSizeEqualToSize in the public method but looks like the assert to guarantee the same size in this method was removed. Let's keep the assert as a safeguard, rely on CGSizeEqualToSize to fail the test, and use either CGImageGetBytesPerRow(referenceImage.CGImage) or CGImageGetBytesPerRow(image.CGImage) for the width here, but not both.