Github user nantunes commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-camera/pull/99#discussion_r42013118
--- 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 were removed, not added...
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]