cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omefire <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request: [iOS] Major refactor
Date Wed, 02 Mar 2016 06:20:08 GMT
Github user omefire commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/185#discussion_r54684008
  
    --- Diff: src/ios/CDVCamera.m ---
    @@ -145,9 +201,38 @@ - (void)takePicture:(CDVInvokedUrlCommand*)command
         [self.commandDelegate runInBackground:^{
             
             CDVPictureOptions* pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
    +        
    +        /*
    +         FIXME #1
    +         What to do about quality?
    +         If the option is set and the image is retrieved from the PhotoLibrary or SavedAlbum
with a NATIVE_URI, no editing,
    +         and is not saved to the photo album, then we return the "wrong" image.
    +         However, the doc says "quality of the **saved** image", so it might be fine.
    +         */
    +        /*
    +         FIXME #2
    +         The doc says: "Rotate the image to correct for the orientation of the device
**during capture**."
    +         Is capture <=> sourceType == CAMERA ?
    +         */
    +        // Check for option compatibility
    +        BOOL isDestinationNativeUri = (pictureOptions.destinationType == DestinationTypeNativeUri);
    +        
    +        BOOL needsResize = [self needsResize:pictureOptions];
    +        BOOL needsOrientationCorrection = pictureOptions.correctOrientation;
    +        BOOL isSourceCamera = (pictureOptions.sourceType == UIImagePickerControllerSourceTypeCamera);
    +        BOOL allowsEditing = pictureOptions.allowsEditing;
    +        BOOL needsSavingToPhotoAlbum = (needsResize || needsOrientationCorrection ||
allowsEditing);
    +        
    +        // if one wants an edited image and a NATIVE_URI, the edited image must be in
the assets library therefore one must set the saveToPhotoAlbum option to true.
    +        if (!pictureOptions.saveToPhotoAlbum && isDestinationNativeUri &&
needsSavingToPhotoAlbum) {
    --- End diff --
    
    Hmmm, I agree that we should ideally not save into the photoAlbum if the user hasn't specified
it in the options.
    But on the other hand, the current behavior is to edit the image anyway, then go ahead
and save it in the assets library/saved photo album anyway.
    Which one should we go with ? I'm not really sure. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message