Display.save() doesn't save retina images.

Hi,

Sorry, I already posted this in the Community Forum before I realized there was a separate venue for subscribers…

I am trying to save a copy of an image loaded from the media.PhotoLibrary using display.save(). I find that this works as expected for the standard iPhone and the iPad but the iPhone 4 only saves a standard resolution image not a retina one.

e.g.
iPhone - saves 320x480 (good)
iPhone 4 - saves 320x480 (bad)
iPad - saves 682x1024 (good)

Here is my config.lua:

[lua]application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
},
}[/lua]

And here is the main.lua:
[lua]local dw=display.contentWidth
local dh=display.contentHeight

function onLoadComplete(event)
if event.target then
local requiredScaleX=dw/event.target.contentWidth
local requiredScaleY=dh/event.target.contentHeight
local requiredScale=math.max(requiredScaleX, requiredScaleY)
event.target:scale(requiredScale, requiredScale)
event.target.x=dw/2
event.target.y=dh/2
display.save(event.target, “myimage.png”, system.DocumentsDirectory)
print(“Loaded image width=”…event.target.width)
end
end

function onTouch(event)
if event.phase==“began” then
media.show(media.PhotoLibrary, onLoadComplete)
end
end

local button=display.newText(“Click to Load Photo”, 0, 0, native.systemFont, 16)
button:setReferencePoint(display.CenterReferencePoint)
button.x=dw/2
button.y=dh/2
button:setTextColor(255,255,255)
button:addEventListener(“touch”, onTouch)[/lua]

Note that the print statement outputs the correct widths for the object in each case, i.e. 382 (iphone), 764 (iphone4), 764 (ipad) respectively. This makes me suspect that it is display.save() that is at fault and not the loading capability of the media.show() function.

Also, I’m not sure why the variable scaling of the loaded media object is necessary using my calculated requiredScale, but this does at least get the image to fill the screen correctly.

Any help gratefully received.

Best regards
[import]uid: 11045 topic_id: 10186 reply_id: 310186[/import]

You double posted. so I deleted the other post.

Looks like this is a bug. Please add to the bug base and I will prioritize it.

Thanks

C. [import]uid: 24 topic_id: 10186 reply_id: 37222[/import]

Ok, I have added case 5705 [import]uid: 11045 topic_id: 10186 reply_id: 37229[/import]

was there a landscape fix for this I remember display.save wouldn’t work in landscape? [import]uid: 11459 topic_id: 10186 reply_id: 38151[/import]

it has been fixed. but something else crept up on ios devices and we are looking at it

but most of the display.save capture bugs have been squashed.

c. [import]uid: 24 topic_id: 10186 reply_id: 38156[/import]

ah cool i will give it a shot [import]uid: 11459 topic_id: 10186 reply_id: 38213[/import]

Looks like this is fixed on the device (Awesome!), but we’re still seeing 320x480 on the iPhone4 Simulator. No biggie. Just thought you should know. [import]uid: 35618 topic_id: 10186 reply_id: 51013[/import]