html5 - Chrome on Android: createObjectURL containing image blob captured from camera is broken -
html5 - Chrome on Android: createObjectURL containing image blob captured from camera is broken -
this worked me before, broken on few (but not all) android devices using chrome (v38 canary/beta broken).
if input set capture camera, blob returned invalid (a broken image appears). if unset attribute , take gallery instead, image loads fine. works on phone, not on few tablets.
does know if has changed in chrome? unfortunately, not sure if chrome on broken devices has been updated.
html:
<form action="" method="post" id="edit_form" enctype="multipart/form-data"> <input {$readonly} id="input" type="file" accept="image/*" capture="camera" /> <div class='fileinput-preview thumbnail' data-trigger="fileinput" style="min-height: 267px; width: 200px; border: 1px solid black;" id="photo_front"></div>
javascript:
$("#input").change(function() { var file = this.files[0]; var imgurl = url.createobjecturl(file), img = document.createelement('img'); img.onload = function() { url.revokeobjecturl(imgurl); }; img.src = imgurl; img.width = 200; $("#photo_front").html(''); $("#photo_front").append(img); });
http://jsfiddle.net/yl3e14lj/6/
i posted chrome issue somehow still unconfirmed , moved restricted (no thought means).. seek posting on chromium issue more info have sonner prepare be.
i tested on devices. works : - 4.3.1 (galaxy s i9000 - rooted) - 4.4.4 (nexus 7) - 4.4.3 (htc 1 m8)
not working : - 4.2.2 (samsung tab 3 10.1) - not crashing : not showing image - 4.0.4 (samsung tab 1 10.1) - crashes "aw snap"
looks bound android version
android html5 google-chrome
Comments
Post a Comment