Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images with :nopm: in filename

I'v recently discovered that images taken with Google Hangouts sometimes add a :nopm: to the end of the filename. For example, DCIM/Camera/IMG_20141212_123123:nopm:.jpg

This is causing me a ton of parsing issues. One of the biggest being that when I created a File object out of this path, and try file.exists(), I GET A FALSE!!!!!

My end goal for this is that when I run into one of these :nopm: images, I'd like to just rename it on the device and continue my processing as normal.

Here's my code:

public static void checkForNopm(File file) {

    final String path = file.getPath();

    if (path.contains(":nopm:")) {
        final File newfile = new File(file.getPath().replace(":nopm:",""));
        file.renameTo(newfile);
    }
}
like image 405
The Hungry Androider Avatar asked Dec 15 '14 03:12

The Hungry Androider


1 Answers

Read this:

https://android.stackexchange.com/questions/98266/why-is-there-nopm-in-some-photo-file-names

No solution also. But possibly it is a way for Google Hangout to escape the photo from being managed by other utilities. I search for :nopm: when I was trying to copy some photo I took when playing Ingress and shared with Google Hangout. I came to your question, and then that answer in android listed the second. I believe the answer of "No Photo Manager" is more reasonable than "AM/PM".

If this is really the case, the best method will be manually removing those ":nopm:" before you can manage them by tools. But at the same time, other tools like "Dropbox" can backup these photos as well.

like image 84
Tom K. C. Chiu Avatar answered Sep 22 '22 12:09

Tom K. C. Chiu