CIRawFilter scaleFactor <= 0.5 creates incorrect-sized image when CIRAWFilterOption.allowDraftMode set to "true"

In iOS, I am creating a CIRAWFilter object by calling init() on the image file's URL and setting "CIRAWFilterOption.allowDraftMode : true" in the options dictionary passed in to the init call. If I set a scaleFactor <= 0.5 and then call .outputImage() on the filter object, I get back a CIImage with an extent that is half the size of what I expect. If I set scaleFactor >= 0.51 then I get back a CIImage with the expected extent.

For example, starting with an original RAW image file of size 4,032 x 2,048:

If I set the scaleFactor to 0.75 and call outputImage() on the CIRawFilter object, I get back a CIImage object with the extent 3,024 x 1,536 which has width and height at 75% of the original image's width and height.

However, if I set the scaleFactor to 0.50 and call outputImage() on the CIRawFilter object, I get back an image with the extent 1,008 x 512, which is 25% of the size of the original RAW image and not 50%. If I set "allowDraftMode : false" then I always get back the correctly sized CIImage.

Is this a bug or expected behavior?

Replies

It appears that CIRAWFilter (initialized with imageURL) does not respect its scaleFactor property at all. It always returns the full-size image. I'm going to file a bug today!

Add a Comment