display.save() function cannot work with displayGroup

Hi guys,

I notice that if an image is in a displayGroup, display.save() will not work correctly. It will only display the default background color (which is yellow in this case).

Possible bug (bug report already submitted)

See sample code below.

Hope this helps someone which runs into the same problem.

 local tmpPhoto = display.newImageRect( "testImageInResourceFolder.png" , 100, 100 ) tmpPhoto.x = display.contentCenterX tmpPhoto.y = display.contentCenterY tmpPhoto.alpha = 0.2 displayGroup:insert(tmpPhoto) local selectedImgFilename = "test2.jpg" local baseDir = system.TemporaryDirectory local options = { filename = selectedImgFilename, baseDir = baseDir, backgroundColor = {1,1,0}, isFullResolution = false, jpegQuality = 0.5, -- between 0 1 } display.save( tmpPhoto, options ) -- tmpPhoto:removeSelf() local tmpPhoto2 = display.newImage( selectedImgFilename, baseDir ) tmpPhoto2.x = display.contentCenterX tmpPhoto2.y = display.contentCenterY tmpPhoto2.alpha = 0.5

Hi @yosu,

Can you try saving it as a PNG instead of a JPG and see if the results differ?

Thanks,

Brent

Hi @yosu,

Can you try saving it as a PNG instead of a JPG and see if the results differ?

Thanks,

Brent

I can confirm that I have saved it as a PNG, but it still doesn’t work. This is similar to: https://forums.coronalabs.com/topic/59155-corona-bug-displaycapture-does-not-work-on-images-larger-than-screen-size/

I can confirm that I have saved it as a PNG, but it still doesn’t work. This is similar to: https://forums.coronalabs.com/topic/59155-corona-bug-displaycapture-does-not-work-on-images-larger-than-screen-size/