Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3d5a21f authored by Julian Mancini's avatar Julian Mancini
Browse files

Round Lat/Long values to three decimals

Although we might cut Lat/Long display all together, this is a small fix
to land right now in case we do keep both the Address and the
coordinates.

Bug: 64266500
Test: MediaViewTest.java
Change-Id: I786196f5c289eed1a5946474d144e015fdf43e58
parent e76007b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
     In U.S. English this is denoted by a number followed by "MP". E.g. 12.2MP or 8MP. -->
    <string name="metadata_dimensions_display"><xliff:g id="width" example="1280">%1$d</xliff:g> x <xliff:g id="height" example="1024">%2$d</xliff:g> - <xliff:g id="megapixels" example="12.2">%3$,.1f</xliff:g>MP</string>
    <!--The location of where a photo was taken. (i.e. latitude, longitude) Note that this is probably camera EXIF data.-->
    <string name="metadata_location">Location</string>
    <string name="metadata_coordinates">Coordinates</string>
    <!--The elevation the photo was taken. Note that this is probably camera EXIF data.-->
    <string name="metadata_altitude">Altitude</string>
    <!--The company that made the camera the photo was taken on. Note that this is probably camera EXIF data.-->
+2 −2
Original line number Diff line number Diff line
@@ -105,14 +105,14 @@ public class MediaView extends TableView implements MediaDisplay {
        if (MetadataUtils.hasExifGpsFields(tags)) {
            double[] coords = MetadataUtils.getExifGpsCoords(tags);
            if (geoClickListener != null) {
                table.put(R.string.metadata_location,
                table.put(R.string.metadata_coordinates,
                        String.valueOf(coords[0]) + ",  " + String.valueOf(coords[1]),
                        view -> {
                            geoClickListener.run();
                        }
                );
            } else {
                table.put(R.string.metadata_location,
                table.put(R.string.metadata_coordinates,
                        String.valueOf(coords[0]) + ",  " + String.valueOf(coords[1]));
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ final class MetadataUtils {
        String latRef = exif.getString(ExifInterface.TAG_GPS_LATITUDE_REF);
        String lonRef = exif.getString(ExifInterface.TAG_GPS_LONGITUDE_REF);

        double round = 1000000.0;
        double round = 1000.0;

        double[] coordinates = new double[2];

+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class MediaViewTest {

        mTable.assertHasRow(R.string.metadata_dimensions, "3840 x 2160, 8.3MP");
        mTable.assertHasRow(R.string.metadata_date_time, "Jan 01, 1970, 12:16 AM");
        mTable.assertHasRow(R.string.metadata_location, "33.995918,  -118.475342");
        mTable.assertHasRow(R.string.metadata_coordinates, "33.996,  -118.475");
        mTable.assertHasRow(R.string.metadata_altitude, "1244.0");
        mTable.assertHasRow(R.string.metadata_make, "Google");
        mTable.assertHasRow(R.string.metadata_model, "Pixel");