SimpleMobileTools / Simple-Gallery

A premium app for managing and editing your photos, videos, GIFs without ads
https://www.simplemobiletools.com
GNU General Public License v3.0
3.6k stars 758 forks source link

Error When Moving Files Containing an emoji in Filename to SD Card Folder #2621

Open OkyDooky opened 1 year ago

OkyDooky commented 1 year ago

I've recently gotten a microSD card and have started moving downloaded image sets to it, but came across a toast message saying "Error: java.lang.NullPointerException". All but two of the images that have prompted this, so far, have contained an emoji in the filename. The images that prompt this error message are not moved to the target folder (a follow-up toast informs me of this). However, if I move them to another folder on Internal Storage, it moves just fine. I am on Android 7.1.2 (LineageOS) with this phone. And I just tested this on my other device (stock Android 9) and it doesn't seem to have this issue.

OkyDooky commented 1 year ago

I have not searched anything related to this, but it might be an issue with Android and not the app. I tried moving files to the SD card using Aves gallery and it also left the files with emojis in their titles on Internal Storage. It would be nice if there was an app-level workaround for this. But, if not, that's fine. I'll test if file browsers can handle this.

tibbi commented 1 year ago

I havent researched it all, filenames are not supposed to have emojis...

OkyDooky commented 1 year ago

I just did some more testing, and it's looking like a system limitation. On my older device, I cannot rename a file with an emoji in it when using Amaze (file manager), let alone move it to the SD card. But, on my newer device (Android 9), I can do both with no issues.

filenames are not supposed to have emojis...

For the record, the only reason this happened at all is because of a 3rd party Pixiv browser/downloader app I have on my older phone, since I have it add the image titles and author usernames into the filename for convenience. Sometimes either or both will contain an emoji. It somehow saves them just fine and I can do regular file operations with them in this gallery app (like reencoding them, renaming, or even moving around...as long as it's not to the SD card).

barbedknot commented 1 year ago

This just happened to me, but worse.

I moved a tiktok video from desktop to mobile (android 6.0.1), and it had emojis in the filename, resulting in the video on my mobile device having a 0-byte filesize. Once I realized this, on desktop I copied the original, renamed the copy, and successfully transferred the renamed (devoid of emojis) copy to my mobile device.

The above is a simplified version of events: in truth, I originally moved 10 tiktok videos from desktop to mobile, 3 of them had emojis in the filename, and it took me a few deleting and transferring attempts to understand emojis being the common denominator.

In any case, the result is I now have four apparently nonexistent files in the destination folder in question, only visible in Simple Gallery (which is to say, not visible in file explorer on the mobile device itself, nor on desktop). I can't do anything with these files. Trying to rename them or move them (even to the recycle bin) results in the following error: Error: kotlin.io.NoSuchFileException: /path/filename.fileextension: The source file doesn't exist. ("path", "filename", and "fileextension" are placeholders I used instead of the real thing)

Trying to hide them or no-confirm delete them returns An unknown error has occurred. Trying to rotate them just stalls indefinitely. Adding them to favorites works for a second, before reverting.

Moving the folder they're in results in the path to said nonexistent file changing along with it. Perhaps I would be able to delete the folder if I tried, but I haven't tried. Clearing cache doesn't remove these apparently nonexistent files.

I've exported my settings, and can try clearing the app data, especially considering how miserable the support for this situation appears to be, judging by searching "emoji" on this github issues page. Worst case I should just screenshot my settings instead, and clear the app data without importing my settings.

I am no programmer, so I am in no position to judge what "I havent researched it all, filenames are not supposed to have emojis..." means, or comes from. Maybe it is better for practice to cull emojis from filenames, for compatibility purposes. But I would think that is only a useful reply to fellow programmers. As a consumer, I can't do anything with this reply. I have come to you demonstrating as much to be true prior to you replying with that. Your reply adds no new information. I don't know what you expect of me. I guess it's saying "tough luck". Thanks. Cheers.

barbedknot commented 12 months ago

I've exported my settings, and can try clearing the app data, especially considering how miserable the support for this situation appears to be, judging by searching "emoji" on this github issues page. Worst case I should just screenshot my settings instead, and clear the app data without importing my settings.

Well, not that anyone cares, but I just bothered deleting the app data, and the four non-files were still there. I even tried uninstalling and reinstalling the app, and the result was the same. So I guess I have literally zero recourse.

RokeJulianLockhart commented 8 months ago

https://github.com/SimpleMobileTools/Simple-Gallery/issues/2621#issuecomment-1714902174

@barbedknot, file a bug in the AOSP bug tracker with the same or better detail about the issue (but stated as concisely as possible). That's your recourse. The AOSP developers can liaise with OEMs when it's a downstream bug caused by the ROM developers instead of upstream AOSP.

However, be aware that they expect you to be able to (learn how to) use debug features like adb to verify the problem at a lower level.

Please link it here if you do file one.