Closed
Bug 1176682
Opened 11 years ago
Closed 11 years ago
Capturing photo with camera in <input type="file"> doesn't trigger its "onchange" event nor it fills the files list.
Categories
(Firefox for Android Graveyard :: Audio/Video, defect)
Tracking
(firefox38.0.5 wontfix, firefox39 wontfix, firefox40 wontfix, firefox41 wontfix, firefox42 fixed, fennec+)
RESOLVED
FIXED
Firefox 42
People
(Reporter: derenio+firefox, Assigned: droeh)
References
Details
Attachments
(2 files, 1 obsolete file)
|
524 bytes,
text/html
|
Details | |
|
1.36 KB,
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150513174244
Steps to reproduce:
I've followed the tutorial from:
https://developer.mozilla.org/en-US/docs/Web/Guide/API/Camera
that is:
<html>
<body>
<input type="file" id="take-picture" accept="image/*">
<script>
var takePicture = document.querySelector("#take-picture");
takePicture.onchange = function (event) {
console.log(this.files);
console.log(event.target.files);
// Get a reference to the taken picture or chosen file
var files = event.target.files,
file;
if (files && files.length > 0) {
file = files[0];
}
};
takePicture.click = function (event) {
console.log('click', event);
};
</script>
</body>
</html>
Actual results:
If I click the file input and pick an existing photo from e.g. "photos" app it properly fills in the input, but if I choose the camera and take a new photo, it isn't filled in nor is the "onchange" callback called.
Also I have the taken photo saved in the "/sdcard/" main directory.
Expected results:
The "onchange" event should be fired and the file input filled with the take photo.
| Reporter | ||
Updated•11 years ago
|
OS: Unspecified → Android
Hardware: Unspecified → ARM
| Reporter | ||
Comment 1•11 years ago
|
||
I should add that it fails on:
- 2 different Nexus 4, Android 5.1.1 devices,
It works on:
- X86 emulator of Android 5.1,
- and Moto X 2014 with Android 5.1
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
I think I can reproduce this on a Nexus 5 running the Android M preview. I cannot reproduce on a Samsung Galaxy S5 running Android 5.x.
Status: UNCONFIRMED → NEW
tracking-fennec: --- → ?
Ever confirmed: true
Comment 4•11 years ago
|
||
All current versions are affected.
status-firefox38.0.5:
--- → affected
status-firefox39:
--- → affected
status-firefox40:
--- → affected
status-firefox41:
--- → affected
status-firefox42:
--- → affected
Comment 5•11 years ago
|
||
1. load the testcase from comment 2
2. tap the browse button
3. select the camera app if needed
4. take a photo
Expected results: text field updates to the file name, normally a date-time-string.jpg
Actual results: text field still shows No file selected.
Comment 6•11 years ago
|
||
To debug this, we'd need to break in here:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/FilePickerResultHandler.java#62
and see what results we're getting. We don't support quite the "correct" way of handling this (i.e. pass a content-uri to the page, opening a java inputStream when it was requested by the page), but I'm not sure why our old method would have stopped working.
Updated•11 years ago
|
Assignee: nobody → droeh
tracking-fennec: ? → +
| Assignee | ||
Comment 7•11 years ago
|
||
I can't reproduce this; following kbrosnan's steps from comment 5 produces the expected result (text field updates to the filename of the photo taken).
This is on a Nexus 6 running 42.0a1 and android 5.1.1
| Assignee | ||
Comment 8•11 years ago
|
||
Android M seems to return an empty Intent rather than a null intent to onActivityResult from camera activity; updated the function to check for an empty Intent if the intent is not null.
Attachment #8630740 -
Flags: review?(snorp)
Updated•11 years ago
|
Attachment #8630740 -
Flags: review?(snorp) → review+
Comment 9•11 years ago
|
||
Comment on attachment 8630740 [details] [diff] [review]
Proposed patch
Review of attachment 8630740 [details] [diff] [review]:
-----------------------------------------------------------------
Oops, I acted too quickly. This needs a better commit message. It should say what the patch does.
Attachment #8630740 -
Flags: review+ → review-
| Assignee | ||
Comment 10•11 years ago
|
||
Updated commit message.
Attachment #8630740 -
Attachment is obsolete: true
Attachment #8630748 -
Flags: review?(snorp)
Updated•11 years ago
|
Attachment #8630748 -
Flags: review?(snorp) → review+
Updated•11 years ago
|
Keywords: checkin-needed
Comment 11•11 years ago
|
||
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Updated•6 years ago
|
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•