My problem as as the above topic. I have the exact same image. When loaded in media.selectPhoto through image gallery, it scales perfectly. When i take the exact same image through media.capturePhoto, the scaling is deformed. I put them through the same listener so they should work the same. I have attached the two different scaling image . Is this due to some config issue? Please advise on this. Thanks!
Code as follows:
if(myData.uploadMode == 1) then if media.hasSource( media.Camera ) then media.capturePhoto( { listener = onComplete} ) else native.showAlert( "Corona", "This device does not have a camera.", { "OK" } ) end else if media.hasSource( media.PhotoLibrary ) then media.selectPhoto( { mediaSource = media.PhotoLibrary, listener = onComplete } ) else native.showAlert( "Corona", "This device does not have a photo library.", { "OK" } ) end end
What happens if you don’t scale the image in the onComplete function? Is there a reason why you’re using that specific scaling math instead of just placing the image?
I took out the scaling in the function but the problem still persist. I went one step further and tried taking pictures from the provided camera sample code in SDK. It had the same problem. It seems pictures taking with camera are always ** stretched horizontally , no such problem if loaded from gallery. **Below is a snapshot of the image taken from the camera sample code.
The Corona Simulator does try to use the Mac iSight camera. However, you can’t look at it’s behavior as something you can expect your apps to do. Try building for the device and run it that way.
What happens if you don’t scale the image in the onComplete function? Is there a reason why you’re using that specific scaling math instead of just placing the image?
I took out the scaling in the function but the problem still persist. I went one step further and tried taking pictures from the provided camera sample code in SDK. It had the same problem. It seems pictures taking with camera are always ** stretched horizontally , no such problem if loaded from gallery. **Below is a snapshot of the image taken from the camera sample code.
The Corona Simulator does try to use the Mac iSight camera. However, you can’t look at it’s behavior as something you can expect your apps to do. Try building for the device and run it that way.