[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-15 Thread elsewhat
Github user elsewhat commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-210530740
  
@riknoll @jcesarmobile thanks for the input. What's the way forward for 
this pull request?

The your findings requires a bit to much knowledge of the plugin for me to 
handle at the current time. Is it an idea to merge this pull request and open 
the other findings in a new issue? After all this pull request fixes an 
important issue in the current version of the plugin


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-05 Thread riknoll
Github user riknoll commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-205895064
  
That sounds good to me. We can probably just put the images into a 
directory like `cache/cordova-plugin-camera` and routinely wipe it as part of 
`onCreate` or something. Just need to make sure people know to use 
`saveToPhotoAlbum=true` if they need an image persistently stored.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-04 Thread jcesarmobile
Github user jcesarmobile commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-205672785
  
I like the idea, if we can get the real name, then the new image should be 
realname-modified-timestap, if we can't get the real name, then just use 
modified-timestamp.

About the cache, it seems that we should clean it.

> When the device is low on internal storage space, Android may delete 
these cache files to recover space. However, you should not rely on the system 
to clean up these files for you. You should always maintain the cache files 
yourself and stay within a reasonable limit of space consumed, such as 1MB. 
When the user uninstalls your application, these files are removed.



http://developer.android.com/intl/es/guide/topics/data/data-storage.html#ExternalCache


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-04 Thread riknoll
Github user riknoll commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-205564464
  
If we can get the real image name, we should do that. However, since we are 
modifying it, we should also mark it as such and put `-modified` at the end or 
something. I've also noticed some weird behavior when we always use the same 
filename after modifying images, so we might need to timestamp those files as 
well. We just need to make sure the cache is cleared on a regular basis, I 
forget if Android handles that automatically.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-04 Thread jcesarmobile
Github user jcesarmobile commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-205502326
  
Ok, so we should change 
```
String fileName = realPath != null ?
realPath.substring(realPath.lastIndexOf('/') + 1) :
"modified." + (this.encodingType == JPEG ? "jpg" : "png");
```
As realPath will not be null anymore it doesn't make any sense.

We have some options:
Detect if the fileName have an extension, if not, then use the 
"modified"... approach.
Try to get the real image name, I think that's possible even for Google 
Drive images.

Any other ideas?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-04 Thread riknoll
Github user riknoll commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-205441624
  
Okay, finally got around to testing this on Jelly bean and I found an 
issue: content URIs don't always end in a file type (like .jpg). We try and get 
the filename in `ouputModifiedBitmap` from `getRealPath` (see 
[here](https://github.com/elsewhat/cordova-plugin-camera/blob/CB-10857cordova-plugin-camera/src/android/CameraLauncher.java#L600))
 and so we end up writing to a temporary image without a file extension. I 
don't know if we make assumptions like that anywhere else, but we need to 
address that before merging this. Reproducing camera options:
```
{
mediaType: Camera.MediaType.PICTURE,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,
quality: 50,
allowEdit: false,
encodingType: 0,
correctOrientation: true
saveToPhotoAlbum: true
}
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-01 Thread riknoll
Github user riknoll commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-204598390
  
I think that we should eventually fix it to be consistent (and figure out 
the meaning of NATIVE_URI and FILE_URI for that matter). Also, we should 
definitely make sure it always returns a URI and not a path


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-04-01 Thread jcesarmobile
Github user jcesarmobile commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-204596592
  
Tested that the images are correctly displayed if used on an img tag, and 
can be uploaded to a server using file-transfer.

@riknoll, you are right, the paths we return aren't very consistent, maybe 
we should review them or at least document which params return which kind or 
path.

But for now, this looks good and I think it can be merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-03-31 Thread jcesarmobile
Github user jcesarmobile commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-204137418
  
Sorry, I've been really busy this week and didn't have time to test
The code changes LGTM, but I want to test it tomorrow, and I think we 
should document that google drive will return a content:// url, and maybe the 
limitations of a content:// url


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-03-29 Thread riknoll
Github user riknoll commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-203109141
  
So, I've done a bit of testing on Marshmallow and it seems like this works 
pretty well. It does have the caveat of returning a `content://` URI, but that 
isn't a huge deal in my book. Currently, depending on the camera options you 
pass it is possible to get back either a `content://` URI, `file://` URI, or a 
file path back, so we aren't consistent at all anyway.

@jcesarmobile does this look alright to you? I plan to do some more testing 
on Jelly Bean in a bit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-03-29 Thread elsewhat
Github user elsewhat commented on the pull request:


https://github.com/apache/cordova-plugin-camera/pull/198#issuecomment-202773421
  
Pull request has been tested by debugging. The cordova-plugin-camera plugin 
was added to a local cordova project from my forked repository and the new 
commit. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: CB-10857 android : Camera.getP...

2016-03-29 Thread elsewhat
GitHub user elsewhat opened a pull request:

https://github.com/apache/cordova-plugin-camera/pull/198

CB-10857 android : Camera.getPicture return null for Google Drive (camera 
2.1.1)

FileHelper getRealPath will fallback to URI string if no other type of
path has been found

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/elsewhat/cordova-plugin-camera 
CB-10857cordova-plugin-camera

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-camera/pull/198.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #198


commit b8b9b5abced904f1b0990eef6ee8acf3e6b44987
Author: Dagfinn Parnas 
Date:   2016-03-29T06:56:52Z

CB-10857: Camera.getPicture return null for Google Drive (camera 2.1.1)

FileHelper getRealPath will fallback to URI string if no other type of
path has been found




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org