Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast
Started by usmanmughal.uog Jan 30 2019 03:52 AM

1 reply to this topic
cgimagecreate alphainfo kcgimagealphanone kcgimagealphanoneskiplast black image display.save display.capture
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

usmanmughal.uog

[GLOBAL: userInfoPane.html]
usmanmughal.uog
  • Enthusiast

  • 64 posts
  • Corona SDK

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

 

 



[TOPIC: post.html]
#2

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 804 posts
  • Corona Staff

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 Gthub page and attach sample if timer.performWithDelay didn't work? 




[topic_controls]
[/topic_controls]