I'm trying to use CgFileFormat formatMatchingFile: aFilePath ifNone:  to determine the CgImageFileFormat sub class to use to read an image file. When the image is a JPEG file, CgFileFormat>formatMatchingFile:ifNone: fails to fine the CgImageFileFormat sub class of CgJPEGFileFormat .
The problems seems to be in CgJPEGFileFormat>formatMatchesByteStream: at:
- Code: Select all
(appn verify and: [appn segmentMarker == APP0])
The test for "appn segmentMarker == APP0" looks like the problem as APP0 is 16rFFE0 and the file contains 16rFFE1. The thing is I am able to read and display the file with CgJPEGFileFormat, just fine. Every jpg file I've tried fails the test but is able to be read and displayed.
Is this a bug or am I missing something?