How can I get the info of an image with exifinterface in the fragment

103 Views Asked by At
Uri uri = ImageView.setImageURI(Uri.parse(new File(path).toString()));
gfgIn = getContentResolver().openInputStream(uri);
ExifInterface exifInterface = new ExifInterface(gfgIn);

The code above isn't work in my fragment. How can I rewrite it ?

1

There are 1 best solutions below

4
On

Like most Android SDK classes, ExifInterface has documentation. In particular, that documentation contains a list of public constructors.

The first such constructor takes a File as its sole constructor parameter.

You appear to be looking to get this information from a File, identified by a variable named path.

So, use new ExifInterface(path).