I though so also. When I ran your code, I got the photo with that resolution (1632 x 1224) and the photo was scaled to 0.6667 (the display.contentScaleX, Y on Galaxy S1).
I then changed manually the scale to 0.75 and I was able to save the photo with 1836 x 1337. So, the (1632x1224) was not the limit.
EDIT: I kept interating the scale factor and with 0.83 I saved the photo with 2031 x 1521. When I changed for 0.84, the photo was saved as black with 2055 x 1542. So, I think the really limit is the 2048 (that is the maxTextureSize of the device). But I was not able to get via code the scale factor that would give me the image with maximum dimension. I tried using local scaleFactor = math.min(2048 / photo.width, 2048 / photo.height) but I kept getting a scaleFactor of 1.25 what I believe is because the original image in the screen was not loaded with a resolution less than 2048. Maybe is something related to the dynamic scaling…
EDIT 2: Yes, it was the dynamic scaling. I disabled it and was able to save the image with 2048 x 1536 by calculating the scaleFactor = math.min(2048 / photo.width, 2048 / photo.height). So, to ensure that the device does not save a black image and save with the maximum resolution allowed, I just need to adapt your code from:
--temporarily scale to full scale before save photo.xScale = display.contentScaleX; photo.yScale = display.contentScaleY;
to:
--temporarily scale to full scale before save local maxTextureSize = system.getInfo("maxTextureSize") local scaleFactor = math.min(maxTextureSize / photo.width, maxTextureSize / photo.height) photo.xScale = scaleFactor photo.yScale = scaleFactor