evermeer / PassportScanner

Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
BSD 3-Clause "New" or "Revised" License
457 stars 101 forks source link

CGImageCreate: invalid image #23

Closed punto2018 closed 5 years ago

punto2018 commented 5 years ago

The library works fine, but looking the console while the demo is running the following log is shown repeatedly.

PassportScanner[7819:1822032] [Unknown process name] CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast

I've searched but the constant kCGImageAlphaNone is never used. Also it is not clear what line of code generate this warning.

Any idea on how to debug it? Thanks!

evermeer commented 5 years ago

I think I remember that issue from the beginning. It was caused by the PictureOutput when it is calling the imageAvailableCallback. I think there is threading / timing issue inside the GPUImage2 library. I tried upgrading to GPUImage3 but too much was changed to do that quickly.

Inside GPUImagePicture there is a function initWithCGImage which can set the bitmapInfo to kCGImageAlphaNone based on the bitmask of the image info itself. That bitmap can have a kCGImageAlphaNone.

evermeer commented 5 years ago

Since this is not an issue for PasportScanner and it has no impact for the library I will close this issue.