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

Where does Perspective save edited images? #3

Open
yephny opened this issue Jan 12, 2023 · 23 comments
Open

Where does Perspective save edited images? #3

yephny opened this issue Jan 12, 2023 · 23 comments
Assignees
Labels
bug Something isn't working

Comments

@yephny
Copy link

yephny commented Jan 12, 2023

Where can I find the images edited by Perspective?

@danopdev
Copy link
Owner

They are saved in "Pictures\Perspective" but you should be able to find them in the Gallery application.
Unfortunately with the latest android versions my method to add them to Gallery does not works.
I change the method but it will be for the next release.

Can you please try with a file explorer if the files are present in "Pictures\Perspective" folder ?

@yephny
Copy link
Author

yephny commented Jan 12, 2023

That's where I checked as well, there's no /sdcard/Pictures/Perspective.

Android 10, LineageOS.

@danopdev
Copy link
Owner

It's strange the "sdcard" in the path.
The full path is actually "/storage/emulated/0/Pictures/Perspective" but maybe "/storage/emulated/0/" don't exists on all devices.

@yephny
Copy link
Author

yephny commented Jan 12, 2023

@danopdev On my device, /sdcard/ just redirects to /storage/emulated/0/, which does exist.

@danopdev
Copy link
Owner

It's strange. I'll try to find another method to get Pictures folder.
Do you know the path on your device ?

@yephny
Copy link
Author

yephny commented Jan 16, 2023

It's /storage/emulated/0/Pictures/.

@yephny
Copy link
Author

yephny commented Jan 16, 2023

Comparing yours to PixaPencil's code,

Perspective: Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).absolutePath

PixaPencil: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_PICTURES)

Could it be because yours has the extra Public bit? Might also be .absolutepath.

@danopdev
Copy link
Owner

Actually Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).absolutePath is the current code, but previous release used a hardcoded location.

On my device both methods returns: /storage/emulated/0/Pictures

Can you see please check what are the values for both methods ?

@yephny
Copy link
Author

yephny commented Jan 17, 2023

@danopdev How do I check that?

@yephny
Copy link
Author

yephny commented Jan 17, 2023

It still won't work on version 1.8.

@danopdev
Copy link
Owner

You need to write a small program for that, but I can try a different approach:

If I generate 2 special builds:

  1. File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_PICTURES) + "\Perspective"
  2. File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_PICTURES)

Can you please test them ?

@yephny
Copy link
Author

yephny commented Jan 18, 2023

Sure, I can test them.

@danopdev
Copy link
Owner

danopdev commented Jan 18, 2023

In the ZIP file you can find the 2 applications:

  • 1.10 = > try to save to File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_PICTURES)
  • 1.12 => try to save to File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_PICTURES) + "\Perspective"

Please try both of them (I have a preference for 1.12)

Test applications.zip

@yephny
Copy link
Author

yephny commented Jan 18, 2023

Tried both out, none works. Kotatsu, Imagepipe, PxerStudio, Resplash all work for reference.

@danopdev
Copy link
Owner

This is really strange.
Do you have the little toast saying the save was OK or failed ?

@yephny
Copy link
Author

yephny commented Jan 19, 2023

Yeah, the toast's there. It says Saved to image_name.png.

@danopdev
Copy link
Owner

OK, I didn't checked the save result.
This is a new build that do it and also show the full path in the toast.
Can you please try it ?
Also can you try to save it as JPEG too ?
Perspective.zip

@yephny
Copy link
Author

yephny commented Jan 20, 2023

I tried all the outputs, they all result in the same error: Failed to save: /storage/emulated/0/Pictures/Perspective/image_name.jpeg. Manually creating the Perspective directory won't help either.

@danopdev
Copy link
Owner

At least it's consistent with the result :)
What if you manually create the folders "Pictures/Perspective" ?
If still don't works, I'm out of ideas.

@yephny
Copy link
Author

yephny commented Jan 20, 2023

Nope, still won't work even with Pictures/Perspective/ present.

@danopdev
Copy link
Owner

The only thing left is that I use OpenCV to write the file (it support TIFF & 16 bit PNG).
But this is not that important.
I will try to use android system to save the file.

@danopdev
Copy link
Owner

Last chance. This time I try to save the file using android libraries and not OpenCV.
Can you please give it a try ?
Perspective_1.14.apk.zip

@yephny
Copy link
Author

yephny commented Jan 23, 2023

@danopdev Once again, it fails.

@danopdev danopdev self-assigned this Jun 27, 2023
@danopdev danopdev added bug Something isn't working duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants