-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
if i pick a path from my gallery, serialize that, and then use LoadImageAtPath it said that the file path is not found. but if i use the google foto Instead it works #328
Comments
At first glance, your code looks good to me. Can you try the example code? If that doesn't work, I'll need logcat logs but if you test the example code as is, I'm %95 sure that it will work. |
BTW NativeFilePicker.ConvertExtensionToFileType doesn't accept multiple extensions. |
i rewrite the code like te example but still dosen't work
i also put 512 like the example but still. Can a solution be to save the photo i pick from gallery or from camera to the google photo ? although it will be stupid becouse it will be like having 2 identical photos |
ok now i dont know what i touched but the camera photo works, now the only problem is the phone gallery |
ye both the path of the google photo and the camera photo are inside the application cache instead hte path of the phone gallery is not so im pretty sure thats the problem |
Can you try the example code with no modifications at all, with no transform.GetChild calls or GetComponent calls? Just as is. |
I already tried that but il still don't work idk what to do anymore |
Can you check logcat logs? You can use Unity's Logcat package for that. |
it didnt say much i also log the json file and like i said the path il right but when i return on the app the "Mmai" save is disappear becouse i cannot find the image |
now i save the image path e when the part of the code that get the path and loaded it, the log say this : |
Hmm, the logs state that a valid image path is returned which is good. NativeGallery isn't supposed to return inaccessible image paths. Since you mentioned a NullReferenceException and the fact that I had seen cases which could not be reproduced in a new project, I want to ask you to test the example code in a new project with only NativeGallery installed and no modifications to the example code. |
i tried copy your example code on another project and still it load the image from the phone gallery but when i save te path on a text file and re-use the method it say that the path does not exist. |
Alright it's good news that the image can be loaded immediately after it's picked. Are you saving and loading in the same session or restarting the app beforehand? In the latter case, if you call your save load functions in the same session, does it work? |
i call the save function every time the app go on pause and if i reuse the path in the same session does not work |
It goes against everything I know. Can you create a repro project for me to reproduce the issue? |
It might be private, I can't access it :] |
You could zip the Assets folder of your small repro project, that'd be fine for me. |
…ages after the app is restarted but it isn't recommended (see the relevant FAQ entry)(#328)
I was able to reproduce the issue. It seems that without the I've added a way to fix this issue but it isn't the recommended way to resolve it. Please see the newly added FAQ entry for "I save the picked image's path for later use but I can no longer access it after restarting the app" to learn more. |
Description of the bug
i trie to save the path using Application.persistentDataPath and it work on my pc and if i use google photo, but if i take a photo using NativeCamera.TakePicture or NativeGallery.GetImageFromGallery with the android gallery the serialized path does not work.
here the code
this is the filePyckerSystem
private void Start()
{
FinalPath = "";
Permission = NativeFilePicker.Permission.Granted;
GalleryPermission = NativeGallery.Permission.Granted;
CameraPermission = NativeCamera.Permission.Granted;
for the save i just put i a json file some variables between here a string with the path.
thanks in advance ( sorry for theEnglish not my native language)
The text was updated successfully, but these errors were encountered: