cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cody Balos (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-9490) LG G4 camera application saves photos when using destinationType DATA_URL
Date Tue, 18 Aug 2015 08:37:45 GMT

    [ https://issues.apache.org/jira/browse/CB-9490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700664#comment-14700664
] 

Cody Balos edited comment on CB-9490 at 8/18/15 8:36 AM:
---------------------------------------------------------

A decision needs to be made about how this patch is implemented. I have a working, and tested
fix ready to go, however, it highlights an existing "issue". Currently, the camera plugin
checks the number of pictures saved to the device before any pictures are captured using the
camera started via the plugin, and then checks the difference between the amount of photos
before and after. Relying on this method introduces the possibility of deleting photos a user
takes outside the cordova started camera. For example, consider this scenario: 

A user of a cordova application utilizes a cordova-plugin-camera backed camera feature , and
while in the camera activity, switches to a different application. While in this different
application the user takes a photo. Now the user returns to the cordova application, and is
still in the camera activity. They take the photo, and accept it. Now the cleanup process
inside cordova-plugin-camera begins, but, because of relying on the difference between the
amount of photos before and after the activity, the photo the user took outside of the cordova
application is deleted. 

This issue exists already in the checkForDuplicateImage function, does have the ill behavior
from the above example. However, it is limited by its implementation to removing no more than
2 of the photos taken outside of the cordova application. 


was (Author: cojomojo):
A decision needs to be made about how this patch is implemented. I have a working, and tested
fix ready to go, however, it introduces a potential "issue" that is actually kind of in existence
already. Currently, the camera plugin checks the number of pictures saved to the device before
any pictures are captured using the camera started via the plugin, and then checks the difference
between the amount of photos before and after. Relying on this method introduces the possibility
of deleting photos a user takes outside the cordova started camera. For example, consider
this scenario: 

A user of a cordova application utilizes a cordova-plugin-camera backed camera feature , and
while in the camera activity, switches to a different application. While in this different
application the user takes a photo. Now the user returns to the cordova application, and is
still in the camera activity. They take the photo, and accept it. Now the cleanup process
inside cordova-plugin-camera begins, but, because of relying on the difference between the
amount of photos before and after the activity, the photo the user took outside of the cordova
application is deleted. 

Now the reason, I say this issue is kind of in existence already, is because the checkForDuplicateImage
function, does have the ill behavior from the above example. However, it is limited by its
implementation to removing no more than 2 of the photos taken outside of the cordova application.


So the question is, does this new issue from the example get ignored because of the low probability
of it happening in actual use? If, not, what is the best way around this?

> LG G4 camera application saves photos when using destinationType DATA_URL
> -------------------------------------------------------------------------
>
>                 Key: CB-9490
>                 URL: https://issues.apache.org/jira/browse/CB-9490
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>         Environment: LG G4, Android 5.1
>            Reporter: Cody Balos
>            Assignee: Cody Balos
>          Time Spent: 6h
>  Remaining Estimate: 0h
>
> So far this issue only happens on an LG G4 using the stock camera application:
> Using the camera plugin, with destinationType set to DATA_URL,
> the expected functionality is for the base64 string to be returned to the javascript
interface, and not saved to the file system without explicitly saving it separately. Using
the LG G4 stock camera application, all photos are saved even when using destinationType DATA_URL
if the retake option is used. 
> The issue does not occur when using the Google Camera application or Camera 360 (both
on the Play Store). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message