Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(camera): saveToGallery for edited images #602

Merged
merged 2 commits into from
Sep 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -583,14 +583,11 @@ private void editImage(PluginCall call, Uri uri, ByteArrayOutputStream bitmapOut

private Intent createEditIntent(Uri origPhotoUri) {
try {
Uri editUri = FileProvider.getUriForFile(
getActivity(),
getContext().getPackageName() + ".fileprovider",
new File(origPhotoUri.getPath())
);
File editFile = new File(origPhotoUri.getPath());
Uri editUri = FileProvider.getUriForFile(getActivity(), getContext().getPackageName() + ".fileprovider", editFile);
Intent editIntent = new Intent(Intent.ACTION_EDIT);
editIntent.setDataAndType(editUri, "image/*");
imageEditedFileSavePath = editUri.toString();
imageEditedFileSavePath = editFile.getAbsolutePath();
int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
editIntent.addFlags(flags);
editIntent.putExtra(MediaStore.EXTRA_OUTPUT, editUri);
Expand Down