cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <shaz...@gmail.com>
Subject Re: [Camera Plugin] Add support to save unmodified image to photoalbum
Date Sun, 01 Dec 2013 18:34:04 GMT
The enum thing could work, at least on the iOS side since it is marshalled
into a NSNumber anyway [1].

NSNumber* savetoPhotoAlbum = whatever;
BOOL value = [saveToPhotoAlbum boolValue];

This way it is backwards compatible (with any positive value treated as YES
on older versions of the plugin) yet extensible I suppose.

[1]
https://github.com/apache/cordova-plugin-camera/blob/master/src/ios/CDVCamera.m#L125
[2]
https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/NSNumber_Class/Reference/Reference.html#//apple_ref/doc/uid/20000178-boolValue


On Sun, Dec 1, 2013 at 8:15 AM, Stephan Wezel <s.wezel@web.de> wrote:

> How about the change the saveToPhotoAlbum option to hold enum values
> instead of a boolean value and the possible values would be
>
> 0: saving disabled
> 1: save returned image to photoalbum
> 2. save original image to photoalbum
>
> - Stephan Wezel
>
> On Sunday 01 December 2013 09:20:24 James Jong wrote:
> > IMO the behavior should be:
> > If I'm editing an image I expect the edited image to be saved.
> > If I don't edit it, I expect the unedited image to be saved.
> > -James Jong
> >
> > On Nov 28, 2013, at 4:50 PM, Stephan Wezel <s.wezel@web.de> wrote:
> >
> > > I don't say that this feature should be only for iOS.
> > > I need this feature for my project which isn't iOS only. But iOS is
> the first target.
> > > I came up with this solution because i didn't knew it better.
> > >
> > > I'm also fine if we would redefine what the result is when the option
> saveToPhotoAlbum is active to mean that the original image is saved instead
> the image which is returned to the caller.
> > >
> > > - Stephan Wezel
> > >
> > > On Thursday 28 November 2013 13:05:32 James Jong wrote:
> > >> One consideration here is cross-platform consistency.  Camera is an
> area where we've had issues with platforms having different behaviors for
> the same option.  Currently, you can save the original image with the
> following camera options:
> > >> { allowEdit : false,
> > >>  correctOrientation : false,
> > >>  saveToPhotoAlbum : true
> > >> }
> > >>
> > >> I'm also not sold that adding another save-to-photoalbum option
> (saveUnmodifiedImageToPhotAlbum) is the best way.  May be a bit confusing.
>  If we do add it, the behavior of the 2 options need to be documented
> clearly.  Perhaps it would be better to document the above options as the
> way to get the unmodified image?
> > >>
> > >> -James Jong
> > >>
> > >> On Nov 28, 2013, at 11:18 AM, Stephan Wezel <s.wezel@web.de> wrote:
> > >>
> > >>> Hi Andrew,
> > >>>
> > >>>> Have you signed the Apache CLA?
> http://www.apache.org/licenses/#clas You'll
> > >>>> need to do so before we can accept code from you.
> > >>> No not yet.
> > >>>
> > >>>> Could you clarify your intent with the new flag for me? Is it:
> > >>>> 1. To ensure the image isn't resized at all, or:
> > >>>> 2. To save the unmodified image to the camera roll, but then return
> a
> > >>>> resized image to the app.
> > >>>>
> > >>>> If it's #2, then I think that would be reasonable default behaviour
> > >>>> when saveToPhotoAlbum is set. WDYT?
> > >>> For me it is #2. First i thought that the option saveToPhotoAlbum
> would save the original image from the camera without any changes to it
> (scale, rotate).
> > >>> Because the description of this option doesn't say anything that the
> image, is saved to the photoalbum after a modification (if
> targetWidth/targetHeight, correctOrientation or quality is changed from its
> default value  )
> > >>>
> > >>> But the current implementation (at least under iOS and Android) save
> the photo to the photoalbum after the image is scaled/rotated.
> > >>>
> > >>> So i came up with this patch vor iOS and created a jira entry (
> https://issues.apache.org/jira/browse/CB-5479)
> > >>>
> > >>> I also think that saving the original image would be a reasonable
> default behaviour.
> > >>>
> > >>> On Thursday 28 November 2013 10:47:24 Andrew Grieve wrote:
> > >>>> Thanks Stephan.
> > >>>>
> > >>>> Have you signed the Apache CLA?
> http://www.apache.org/licenses/#clas You'll
> > >>>> need to do so before we can accept code from you.
> > >>>>
> > >>>> Could you clarify your intent with the new flag for me? Is it:
> > >>>> 1. To ensure the image isn't resized at all, or:
> > >>>> 2. To save the unmodified image to the camera roll, but then return
> a
> > >>>> resized image to the app.
> > >>>>
> > >>>> If it's #2, then I think that would be reasonable default behaviour
> > >>>> when saveToPhotoAlbum is set. WDYT?
> > >>>>
> > >>>>
> > >>>> On Thu, Nov 28, 2013 at 4:36 AM, Stephan Wezel <s.wezel@web.de>
> wrote:
> > >>>>
> > >>>>> Hi,
> > >>>>>
> > >>>>> for a project which I'm developing with cordova i need the
> possibility
> > >>>>> to save the unmodified image from the camera to the photoalbum.
> > >>>>>
> > >>>>> I have attached a patch which implements this new functionality
> for iOS.
> > >>>>>
> > >>>>> Regards
> > >>>>>
> > >>>>> Stephan Wezel
> > >>>>>
> > >>>
> > >>
> > >
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message