ContentScaleFactor override?

I have a bad feeling that the answer to this question will be obvious, but I cannot figure it out.

What I want to do is create images, save them, then read them and they not be changed to double size. I am using a 3rd gen iPad and the contentscalefactor is 2. I f I execute this code:

    img = image(500,500)
    saveImage("Documents:test", img)
    loadimg = readImage("Documents:test")
    print("Size = " .. loadimg.width .. " x " .. loadimg.height)

Then the output is 1000,1000. I want my exact pixels, or as close to possible. I am not interested in scaling the image to get it back to size, I want to save and load the exact same pixels. Is this possible?


That looks like a bug — it should read in the saved image as retina (@2x) and output its resolution as 500, 500. We have to fix this.

I think that it is actually working as intended. Using IExplorer I see my file test.png and another file called test(@2x).png. When I call readimage on retina it returns the 2x scaled image, exactly like you say it should.

I wish I could get to that non-scaled image, however. Maybe in a future release there could be a flag to load the original image rather than the retina scaled one.

The main issue is .width and .height on the @2x image should output 500x500 — not 1000x1000. The image.rawWidth and rawHeight should output 1000x1000.

I think I have a similar problem, I read the size of an image (in Dropbox, with retina image) and create a sprite accordingly… With that measured size etc… when I start recording, the images are doubled in size… That seems to be the same thing, or not?

That’s a slightly different issue, but it could be related. Thanks for letting us know.