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

Commit a2c322f5 authored by Ray Chen's avatar Ray Chen
Browse files

3406494 Gallery photos in nonsensical order

Change-Id: Ic992465a6683179bff280753dcaf9aa6372424e6
parent ee57adc2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -794,6 +794,15 @@ public class MediaScanner
                    long time = exif.getGpsDateTime();
                    if (time != -1) {
                        values.put(Images.Media.DATE_TAKEN, time);
                    } else {
                        // If no time zone information is available, we should consider using
                        // EXIF local time as taken time if the difference between file time
                        // and EXIF local time is not less than 1 Day, otherwise MediaProvider
                        // will use file time as taken time.
                        time = exif.getDateTime();
                        if (Math.abs(mLastModified * 1000 - time) >= 86400000) {
                            values.put(Images.Media.DATE_TAKEN, time);
                        }
                    }

                    int orientation = exif.getAttributeInt(