Ok, I have found a workaround.
See the attached text, which contains a routine that shows how to create a CGImage from the NSImage that vImageBuffer_InitWithCGImage can handle successfully for the problematic image files.
Apparently vImageBuffer_InitWithCGImage is brittle and it needs for the CGImage to be rather vanilla which this rendering logic accomplishes.
The files that cause failures are jpegs that came from an Android phone which feature color profiles that confuse vImageBuffer_InitWithCGImage.
This new method seems to fix all the problems, fingers crossed.
CGImageFromNSImage.txt
Topic:
Graphics & Games
SubTopic:
General
Tags: