cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request: Try to use realpath filename i...
Date Wed, 14 Oct 2015 15:25:41 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/99#discussion_r42008539
  
    --- Diff: src/android/CameraLauncher.java ---
    @@ -498,15 +498,19 @@ private void refreshGallery(Uri contentUri)
     
     
     private String ouputModifiedBitmap(Bitmap bitmap, Uri uri) throws IOException {
    +        // Some content: URIs do not map to file paths (e.g. picasa).
    +        String realPath = FileHelper.getRealPath(uri, this.cordova);
    +
    +        // Get filename from uri
    +        String fileName = realPath != null ? realPath.substring(realPath.lastIndexOf('/')
+ 1) : "modified.jpg";
    +
             // Create an ExifHelper to save the exif data that is lost during compression
    -        String modifiedPath = getTempDirectoryPath() + "/modified.jpg";
    +        String modifiedPath = getTempDirectoryPath() + "/" + fileName;
     
             OutputStream os = new FileOutputStream(modifiedPath);
             bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
             os.close();
     
    -        // Some content: URIs do not map to file paths (e.g. picasa).
    -        String realPath = FileHelper.getRealPath(uri, this.cordova);
    --- End diff --
    
    These two lines above seems excess, no? You've got `realPath` already at the beginning
of this method.


---
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