CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast

Hi Folks,

I’m experiencing something odd with display.save. Result image is a black image instead of my actual image. I did tests on iPhone XS MAX, iPhone X, iPhone 7 plus. Old devices results are fine.

Here is my log.

[Device] destFile image1\_w600~temp.jpg [Device] createNewScaleJpjImage: image1~temp.jpg image1\_w600~temp.jpg 600 [Device] new scaled size: 600 600 1502.786377709 [Device] saveResizedImage: 600 1.6875 [Device] CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast

What I’m doing in code.
 

local snapshot = display.newSnapshot(newWidth, newHeight) display.save(snapshot, { filename=filePrms.filename, baseDir=filePrms.baseDir, jpegQuality = jpegQuality, captureOffscreenArea = true }) -- remove the snapshot snapshot:removeSelf() snapshot = nil

I’m getting following error when result is black image.

[Device] CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast

Is it bug or something?

Regards,

Usman Mughal

Hello!

Try using timer.performWithDelay for saving image. Snapshots are not rendered immediately, but rather at the end of the frame. Also, can you report the issue on our Gthubpage and attach sample if timer.performWithDelay didn’t work? 

Hello!

Try using timer.performWithDelay for saving image. Snapshots are not rendered immediately, but rather at the end of the frame. Also, can you report the issue on our Gthubpage and attach sample if timer.performWithDelay didn’t work?