android-ExifInterface_ JNI: original image error not detected
When trying to get exifinterface, I keep seeing error messages that the original image is not detected
ExifInterface exifInterface = new ExifInterface(filepath);
int rotation=exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,ExifInterface.ORIENTATION_UNDEFINED);
Who knows what caused it?
resolvent:
These statements are contradictory. URI is not a file. If the scheme of URI is file, the file system path of the file can only be obtained through getpath(). If the scheme is other content (such as content), you will not be able to obtain the file system path because there is no requirement for a file. For example, The URI of http://stackoverflow.com/questions/42930509/exinterface-jni-raw-image-not-detected-error does not mean that the Android device has a file in / questions / 42930509 / exinterface JNI - no original image error detected
Com. Android. Support: exifinterface in exifinterface (for example, the latest version is 25.3.0) has a constructor that takes an InputStream. Create a contentresolver (through getcontentresolver()) on the context (for example, your activity). Call openinputstream() on the contentresolver to provide URI (applicable to file and content schemes) . pass the InputStream to the exifinterface constructor of the library. At the same time, this ensures that you will not cause security problems to users and avoid worrying about getting the file system path for the content you want to check