Loading res/values/inspector_strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,14 @@ <string name="metadata_date_time">Taken on</string> <!-- Message presenting EXIF aperture information in the tradition "f/2.0" format familiar to users. This format is basically an industry standard that shouldn't be translated, so it is marked as not translatable. --> <string name="metadata_aperture_format" translatable="false">f/<xliff:g id="aperture" example="2.0">%1$,.1f</xliff:g></string> <!--The tag for the focal length of a camera. Note that this is probably camera EXIF data--> <string name="metadata_focal_length">Focal length</string> <!--The format for displaying the focal length of a camera. Note that this is probably camera EXIF data--> <string name="metadata_focal_format"><xliff:g id="length" example="24">%1$.2f </xliff:g>mm</string> <!--The tag for the ISO Speed of a camera. Note that this is probably camera EXIF data--> <string name="metadata_iso_speed_ratings">ISO equivalent</string> <!--The format for displaying ISO speed. Note that this is probably camera EXIF data--> <string name="metadata_iso_format">ISO <xliff:g id="iso_speed" example="35">%1$d</xliff:g></string> <!-- String label for developer/debug file details, specifying which stream types are available. --> <string name="debug_stream_types">Stream types</string> Loading src/com/android/documentsui/inspector/MediaView.java +13 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,19 @@ public class MediaView extends TableView implements MediaDisplay { formatShutterSpeed(tags.getDouble(ExifInterface.TAG_SHUTTER_SPEED_VALUE))); table.put(R.string.metadata_shutter_speed, shutterSpeed); } if (tags.containsKey(ExifInterface.TAG_FOCAL_LENGTH)) { double length = tags.getDouble(ExifInterface.TAG_FOCAL_LENGTH); table.put(R.string.metadata_focal_length, String.format(resources.getString(R.string.metadata_focal_format), length)); } if (tags.containsKey(ExifInterface.TAG_ISO_SPEED_RATINGS)) { int iso = tags.getInt(ExifInterface.TAG_ISO_SPEED_RATINGS); table.put(R.string.metadata_iso_speed_ratings, String.format(resources.getString(R.string.metadata_iso_format), iso)); } } private static void showCoordiantes( Loading tests/unit/com/android/documentsui/inspector/MediaViewTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,8 @@ public class MediaViewTest { */ @Test public void testShowExifData() throws Exception { mResources.strings.put(R.string.metadata_aperture_format, "f/%.1f"); mResources.strings.put(R.string.metadata_focal_format, "%.2f mm"); mResources.strings.put(R.string.metadata_iso_format, "ISO %d"); Bundle exif = mMetadata.getBundle(DocumentsContract.METADATA_EXIF); MediaView.showExifData(mTable, mResources, TestEnv.FILE_JPG, exif, null); Loading @@ -70,6 +71,8 @@ public class MediaViewTest { mTable.assertHasRow(R.string.metadata_camera, "Google Pixel"); mTable.assertHasRow(R.string.metadata_shutter_speed, "1/100"); mTable.assertHasRow(R.string.metadata_aperture, "f/2.0"); mTable.assertHasRow(R.string.metadata_iso_speed_ratings, "ISO 120"); mTable.assertHasRow(R.string.metadata_focal_length, "4.27 mm"); } /** Loading tests/unit/com/android/documentsui/inspector/TestMetadata.java +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ final class TestMetadata { data.putString(ExifInterface.TAG_MODEL, "Pixel"); data.putDouble(ExifInterface.TAG_SHUTTER_SPEED_VALUE, 6.643); data.putDouble(ExifInterface.TAG_APERTURE, 2.0); data.putInt(ExifInterface.TAG_ISO_SPEED_RATINGS, 120); data.putDouble(ExifInterface.TAG_FOCAL_LENGTH, 4.27); } static void populateVideoData(Bundle container) { Loading Loading
res/values/inspector_strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,14 @@ <string name="metadata_date_time">Taken on</string> <!-- Message presenting EXIF aperture information in the tradition "f/2.0" format familiar to users. This format is basically an industry standard that shouldn't be translated, so it is marked as not translatable. --> <string name="metadata_aperture_format" translatable="false">f/<xliff:g id="aperture" example="2.0">%1$,.1f</xliff:g></string> <!--The tag for the focal length of a camera. Note that this is probably camera EXIF data--> <string name="metadata_focal_length">Focal length</string> <!--The format for displaying the focal length of a camera. Note that this is probably camera EXIF data--> <string name="metadata_focal_format"><xliff:g id="length" example="24">%1$.2f </xliff:g>mm</string> <!--The tag for the ISO Speed of a camera. Note that this is probably camera EXIF data--> <string name="metadata_iso_speed_ratings">ISO equivalent</string> <!--The format for displaying ISO speed. Note that this is probably camera EXIF data--> <string name="metadata_iso_format">ISO <xliff:g id="iso_speed" example="35">%1$d</xliff:g></string> <!-- String label for developer/debug file details, specifying which stream types are available. --> <string name="debug_stream_types">Stream types</string> Loading
src/com/android/documentsui/inspector/MediaView.java +13 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,19 @@ public class MediaView extends TableView implements MediaDisplay { formatShutterSpeed(tags.getDouble(ExifInterface.TAG_SHUTTER_SPEED_VALUE))); table.put(R.string.metadata_shutter_speed, shutterSpeed); } if (tags.containsKey(ExifInterface.TAG_FOCAL_LENGTH)) { double length = tags.getDouble(ExifInterface.TAG_FOCAL_LENGTH); table.put(R.string.metadata_focal_length, String.format(resources.getString(R.string.metadata_focal_format), length)); } if (tags.containsKey(ExifInterface.TAG_ISO_SPEED_RATINGS)) { int iso = tags.getInt(ExifInterface.TAG_ISO_SPEED_RATINGS); table.put(R.string.metadata_iso_speed_ratings, String.format(resources.getString(R.string.metadata_iso_format), iso)); } } private static void showCoordiantes( Loading
tests/unit/com/android/documentsui/inspector/MediaViewTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,8 @@ public class MediaViewTest { */ @Test public void testShowExifData() throws Exception { mResources.strings.put(R.string.metadata_aperture_format, "f/%.1f"); mResources.strings.put(R.string.metadata_focal_format, "%.2f mm"); mResources.strings.put(R.string.metadata_iso_format, "ISO %d"); Bundle exif = mMetadata.getBundle(DocumentsContract.METADATA_EXIF); MediaView.showExifData(mTable, mResources, TestEnv.FILE_JPG, exif, null); Loading @@ -70,6 +71,8 @@ public class MediaViewTest { mTable.assertHasRow(R.string.metadata_camera, "Google Pixel"); mTable.assertHasRow(R.string.metadata_shutter_speed, "1/100"); mTable.assertHasRow(R.string.metadata_aperture, "f/2.0"); mTable.assertHasRow(R.string.metadata_iso_speed_ratings, "ISO 120"); mTable.assertHasRow(R.string.metadata_focal_length, "4.27 mm"); } /** Loading
tests/unit/com/android/documentsui/inspector/TestMetadata.java +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ final class TestMetadata { data.putString(ExifInterface.TAG_MODEL, "Pixel"); data.putDouble(ExifInterface.TAG_SHUTTER_SPEED_VALUE, 6.643); data.putDouble(ExifInterface.TAG_APERTURE, 2.0); data.putInt(ExifInterface.TAG_ISO_SPEED_RATINGS, 120); data.putDouble(ExifInterface.TAG_FOCAL_LENGTH, 4.27); } static void populateVideoData(Bundle container) { Loading