You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by VIVEK THAKUR <vi...@yahoo.com.INVALID> on 2014/08/19 15:18:56 UTC

CB-7312 Camera Plugin uri scheme

Hello,

I am currently working on CB-7312 which is regarding the camera plugin for android and would like to discuss about it.


Observations:

Using CAMERA a sourceType, returns path with file:// scheme.
But using PHOTOLIBRARY as a sourceType, returns paths with content:// scheme and returns file:// scheme if media is modified by using targetHeight etc.


Conclusion:

Modification/creation of any media using camera plugin for android 4.4.4 returns file:// uri scheme.


Query:

Should'nt the camera plugin be standardized to return a common uri scheme, By converting to a standard uri scheme before passing it to the callbackContext.


Regards
Vivek

Re: CB-7312 Camera Plugin uri scheme

Posted by Lorin Beer <lo...@gmail.com>.
+1 for documenting how uri's should be treated as per Josh's suggestion

-1 for documenting in Next Steps or File Plugin, it would make this
information extremely hard to find. How about a "URI's, Cordova and You"
document for the core Cordova docs?


On Tue, Aug 19, 2014 at 12:13 PM, Marcel Kinard <cm...@gmail.com> wrote:

> +1. Candidate for best practices section in "Next Steps" guide, or in the
> File plugin docs?
>
> On Aug 19, 2014, at 9:49 AM, Josh Soref <js...@blackberry.com> wrote:
>
> > Vivek wrote:
> >> Should'nt the camera plugin be standardized to return a common uri
> >> scheme, By converting to a standard uri scheme before passing it to the
> >> callbackContext.
> >
> > URIs should be treated as opaque. You shouldn't be relying on the URI to
> > be anything, beyond something which can be resolved/loaded.
> >
> > I'm not opposed to picking some random protocol, but I'd rather we
> > actively document that people should not be trying to parse URIs for any
> > particular purpose, and should treat them as opaque references to data.
> >
>
>

Re: CB-7312 Camera Plugin uri scheme

Posted by Marcel Kinard <cm...@gmail.com>.
+1. Candidate for best practices section in "Next Steps" guide, or in the File plugin docs?

On Aug 19, 2014, at 9:49 AM, Josh Soref <js...@blackberry.com> wrote:

> Vivek wrote:
>> Should'nt the camera plugin be standardized to return a common uri
>> scheme, By converting to a standard uri scheme before passing it to the
>> callbackContext.
> 
> URIs should be treated as opaque. You shouldn't be relying on the URI to
> be anything, beyond something which can be resolved/loaded.
> 
> I'm not opposed to picking some random protocol, but I'd rather we
> actively document that people should not be trying to parse URIs for any
> particular purpose, and should treat them as opaque references to data.
> 


Re: CB-7312 Camera Plugin uri scheme

Posted by Josh Soref <js...@blackberry.com>.
Vivek wrote:
>Should'nt the camera plugin be standardized to return a common uri
>scheme, By converting to a standard uri scheme before passing it to the
>callbackContext.

URIs should be treated as opaque. You shouldn't be relying on the URI to
be anything, beyond something which can be resolved/loaded.

I'm not opposed to picking some random protocol, but I'd rather we
actively document that people should not be trying to parse URIs for any
particular purpose, and should treat them as opaque references to data.