Perspective icon indicating copy to clipboard operation
Perspective copied to clipboard

Where does Perspective save edited images?

Open yephny opened this issue 2 years ago • 23 comments

Where can I find the images edited by Perspective?

yephny avatar Jan 12 '23 10:01 yephny

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 ?

danopdev avatar Jan 12 '23 11:01 danopdev

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

Android 10, LineageOS.

yephny avatar Jan 12 '23 12:01 yephny

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.

danopdev avatar Jan 12 '23 12:01 danopdev

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

yephny avatar Jan 12 '23 17:01 yephny

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

danopdev avatar Jan 16 '23 10:01 danopdev

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

yephny avatar Jan 16 '23 14:01 yephny

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.

yephny avatar Jan 16 '23 14:01 yephny

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 ?

danopdev avatar Jan 17 '23 10:01 danopdev

@danopdev How do I check that?

yephny avatar Jan 17 '23 14:01 yephny

It still won't work on version 1.8.

yephny avatar Jan 17 '23 18:01 yephny

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 ?

danopdev avatar Jan 18 '23 10:01 danopdev

Sure, I can test them.

yephny avatar Jan 18 '23 12:01 yephny

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

danopdev avatar Jan 18 '23 13:01 danopdev

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

yephny avatar Jan 18 '23 16:01 yephny

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

danopdev avatar Jan 19 '23 16:01 danopdev

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

yephny avatar Jan 19 '23 16:01 yephny

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

danopdev avatar Jan 20 '23 09:01 danopdev

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.

yephny avatar Jan 20 '23 11:01 yephny

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.

danopdev avatar Jan 20 '23 11:01 danopdev

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

yephny avatar Jan 20 '23 12:01 yephny

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 avatar Jan 20 '23 12:01 danopdev

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

danopdev avatar Jan 23 '23 09:01 danopdev

@danopdev Once again, it fails.

yephny avatar Jan 23 '23 10:01 yephny