Reputation: 31
I am building a web app that will allow the user to take a picture and upload to a folder on server and then the image is displayed on a gallery page. The upload portion works fine but I am having some problems with iOS. When I run the app in safari, everything works fine when you access the camera, you can rotate camera and take portrait or landscape pictures and they upload and render properly on the gallery page. Problem is when it runs in web app mode from the homescreen...if you launch access the camera while in portrait mode, the camera launches but if you turn the phone in camera mode the image rotates too as if it is locking the portrait mode. Is there are way programmatically, to allow the camera to rotate as it does when it runs in safari?
Here is my code, perhaps it is incorrect?
<form action="upload.php" method="post" enctype="multipart/form-data" style="width:100%;">
<span style="text-align: center; word-wrap: break-word;">
Please choose a picture:
<br></span>
<input id="uploadImage" type="file" accept="image/*" name="uploadFile" onchange="PreviewImage();">
<img id="uploadPreview" style="height:120px; width: auto;" />
<script type="text/javascript">
function PreviewImage() {
var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("uploadPreview").src = oFREvent.target.result;
};
};
</script>
<input type="submit" value="Upload File" ><br>
Please wait for window to close after uploading
</form>
Anyone else experience this camera glitch in an iOS webapp?
Upvotes: 2
Views: 1366
Reputation: 1997
Fixed in iOS 10
We had the same issue and it works as of this morning.
Upvotes: 0