Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Chronological Sorting photos in Apple Photos incorrectly

This is a continuation of the post I made before

https://discussions.apple.com/thread/251721134


I installed a clean Big Sur on my MBP but what was called a 'bug in Mojave' still seems a bug in Big sur apparently 2 years later.

My imported photos in photos are sorted semi-random. These are new photos taken with a Canon 5D mark4 (no GPS) which sort correctly in photo viewer Apollo one for example.


Anyone who has their imported photos in photos sorted chronological in Big Sur?


Original post:

Imported photos which I have put in albums are not sorted chronological when I choose to have them sorted as 'Keep sorted as oldest first' or 'Keep sorted as newest first'.

It will show newer photos after older photos sometimes when 'Keep sorted as oldest first' is chosen. I can see this by the 'capture time'.

I double checked in another program which is able to sort photos by EXIF picture capture time taken, sorted correctly every time.

Conclusion: Apple photos is wrong.

Yes, I did the 'Repair library' standard solution... Twice. Still it sorts incorrectly.

Yes, I have also reinstalled the whole macOS already (Mojave) again. (Catalina made made my MacBook Pro crash so often to the point it wasn't a computer anymore).


What can be the problem here?

Posted on Nov 18, 2020 11:39 AM

Reply
15 replies

Nov 18, 2020 12:07 PM in response to Jasper.

This may happen for several reasons. The capture time shown in Photos is not showing the timezone photos used to read the time stamp, when it imported the photos. Because the capture date does not include the time zone, Photos has to sue an educated guest to infer the time zone. Ir will use the timezone of the location the phot has been taken, if the phot is tagged with a GPS location, or the timezone of the system clock, when you import the photos. The safest way toi import photos is to import them to a portable Mac, while you are still in the timezone, where the photos have been taken. If you import them later, after returning home, and the photos are not tagged with GPS, you have to correct the timezone of the capture date.


may also have a problem, if the you are using different cameras, and the date and times of the cameras have been set differently.


Dec 30, 2020 3:10 PM in response to Jasper.

I have this exact problem with photos imported from my Canon EOS 5Dmark4. Perhaps it's a problem with the Canon jpeg files? I generally have GPS turned on, but I notice that sometimes a few photos do not show any "Location" in the Photos app. Those are the ones that appear "out of order". I tried assigning a location but it doesn't make any difference. It's as if Apple Photos doesn't like how Canon is storing the Location metadata or something. I also notice that the sorting may be happening according to the filename as a secondary sort whenever there is no Location. That is, for the files that are appearing out of order because of the missing Location info, the higher file numbers appear "toward the end" of the chronology.

I am on Photos 4 in Mojave and about to upgrade to Catalina. Sad to hear that this still will be a problem even if I go to Big Sur. Amazing that Apple cannot make something like the date a photo was taken, "just work".

Dec 30, 2020 10:32 PM in response to Jasper.

To troubleshoot this we would need at least two (or maybe three with the incorrectly sorted image in between to be able to see a pattern) sample images zipped so their file creation & modification dates might better be preserved during transit (does a .zip file preserve those?) that sort in the wrong order. Hmm... how should those images prepared because Photos may have done its own metadata edits to dates and locations... maybe they could be exported as .tif (Big Sur has flaws in jpg metadata export that might muddy things) so that info is included (or maybe also as originals with IPTC data).

Dec 31, 2020 7:11 AM in response to Matti Haveri

Thank you for your reply. I don't really want to post my family photos, but if you instruct me exactly how to examine the files I can try that and report back. I do have a few metadata reading apps including Photos Exit Editor and Exif-Fixer (although I haven't used them much) if you can instruct what to look for in the photos. OR perhaps I could try to reproduce the problem by taking a series of new "dummy" photos and see if any of them don't get the GPS tag, and thus get mis-sorted after importing to Photos. I really do feel like this is probably a Canon problem, something with how the JPEG files are written when the camera GPS is messing up. And then Apple interprets such photos as a different time for sorting purposes.

Dec 31, 2020 10:19 AM in response to bprice

I have used the following exiftool command. Also GraphicConverter can display similar data via Info > ExifTool.


Show duplicate tags (-a), what groups they belong to (-G1) and actual tag names (-s):


exiftool -a -G1 -s image.jpg


https://exiftool.org/faq.html#Q3


Below is some related info about movie dates and in the middle of the document some exiftool installation and usage info:


https://discussions.apple.com/docs/DOC-250002750

Dec 31, 2020 12:05 PM in response to Matti Haveri

I understand the command but I don't understand what you are suggesting as interpretation of the results. What am I looking for and to what end?

Incidentally, I did another test. Took some photos with Canon EOS 5Dm4 and saved a copy of them from the CF card reader in Finder (they didn't touch Photos at all). Then I imported them into Photos 4. In the Imported section they appear in the correct order, but I suspect that's simply because they were imported in order. I put those photos into an album and while Sort Keep Oldest First is selected, some of the photos appear out of order. The timestamp including EST shows correctly in Info within Photos, the only difference I can notice is that some of the incorrect-order photos are missing Location information (the little map section at the bottom of the Info windows.) In the Adjust DateTime menu, however, these wrong-ordered photos show Eastern Standard Time, and Closest City as New York. These photos may have been taken first, before the Canon GPS was able to obtain enough signal. I then looked at the OTHER photos (the ones I am considering "correct/normal") and noticed that while they do show a Map Location in the Info box, in Adjust Date/Time they have NOTHING in the Time Zone and the Closest City is blank. This again suggests to me that something is wrong with the way Apple is interpreting the GPS info written into the photo by the Canon EOS 5Dm4. If there is missing GPS data, then Apple uses the Time Zone of my Mac? If there is GPS data, it has a blank Time Zone and that messes up the sorting?

I also just updated Canon EOS 5Dm4 to latest firmware from Oct 2020, will report back if that makes any difference in subsequent tests. Otherwise the only practical "fix" I can see is to just give up and turn off the GPS function in my DSLR. Which seems ridiculous, but it's probably more appealing than needing to jump through all sorts of hoops with a complicated importing workflow to try to fix this issue. Mostly I just want my stuff to sort in chronological order. It shouldn't be this hard.

Dec 31, 2020 12:21 PM in response to bprice

I read this https://discussions.apple.com/docs/DOC-250002703 by Leonie and disagree with one aspect. It says you can fix the problem by using the Adjust Date/Time feature in Photos. However, I've tried that (in Photos 4 at least) and it does not correct the wrong sorting. I'm not talking about even hour amounts. The test photos I shot were all in my house, same location as my Mac, all shot within ten minutes. Yet some of the photos taken earlier, show "at the end". It appears these were the photos missing GPS information. I don't consider this test batch definitive, however, because I had other groups of photos where the mis-sorted photos were not just the ones without GPS information. There was also a seemingly some random mis-sorting among the photos that all did have GPS information. We're talking about photos taken just minutes or seconds apart. For example, I had a family photo session and was using auto exposure bracketing, so there were about 30 or so "groupings of 3" photos taken a split second apart. Even some of these showed up in the wrong sort order in Photos! Really maddening.


Dec 31, 2020 12:53 PM in response to bprice

The long list showing all possible tags is confusing. But it can be filtered to show the relevant tags. The following command shows all time tags, and also the MacOS:FileCreateDate i.e. file creation date that is often used as a last resort.


In image files the most important tag for sorting in that list should be the ExifIFD:DateTimeOriginal (I use YYYY-MMDD-hhmm-ss.* filename format in images and movies because it makes troubleshooting and maintenance easier. I routinely set all possible dates the same with GraphicConverter because it makes troubleshooting easier):


[ExifIFD]       DateTimeOriginal                : 2014:06:22 17:01:32


exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all -api RequestAll=2 2014-0622-1701-32.jpg
[ExifTool]      Now                             : 2020:12:31 22:21:40+02:00
[System]        FileModifyDate                  : 2014:06:22 17:01:32+03:00
[System]        FileAccessDate                  : 2020:12:31 22:20:26+02:00
[System]        FileInodeChangeDate             : 2020:12:31 22:17:10+02:00
[MacOS]         FileCreateDate                  : 2014:06:22 17:01:32+03:00
[MacOS]         MDItemContentCreationDate       : 2014:06:22 17:01:32+03:00
[MacOS]         MDItemContentCreationDate_Ranking: 2014:06:22 03:00:00+03:00
[MacOS]         MDItemContentModificationDate   : 2014:06:22 17:01:32+03:00
[MacOS]         MDItemDateAdded                 : 2020:12:31 22:17:10+02:00
[MacOS]         MDItemDateAdded_Ranking         : 2020:12:31 02:00:00+02:00
[MacOS]         MDItemFSContentChangeDate       : 2014:06:22 17:01:32+03:00
[MacOS]         MDItemFSCreationDate            : 2014:06:22 17:01:32+03:00
[MacOS]         MDItemGPSDateStamp              : 2014:06:22
[MacOS]         MDItemInterestingDate_Ranking   : 2020:08:18 03:00:00+03:00
[MacOS]         MDItemLastUsedDate              : 2020:08:18 17:49:36+03:00
[MacOS]         MDItemTimestamp                 : 15:01:27
[MacOS]         MDItemUsedDates                 : 2020:08:18 00:00:00+03:00
[MacOS]         XAttrLastUsedDate               : 2020:08:18 14:49:36
[IFD0]          ModifyDate                      : 2014:06:22 17:01:32
[ExifIFD]       DateTimeOriginal                : 2014:06:22 17:01:32
[ExifIFD]       CreateDate                      : 2014:06:22 17:01:32
[ExifIFD]       SubSecTimeOriginal              : 646
[ExifIFD]       SubSecTimeDigitized             : 646
[GPS]           GPSTimeStamp                    : 15:01:27.61
[Composite]     SubSecCreateDate                : 2014:06:22 17:01:32.646
[Composite]     SubSecDateTimeOriginal          : 2014:06:22 17:01:32.646


This shows all GPS tags that sometimes cause incorrect sorting when different timezones or occasional GPS:GPSTimeStamp interfere with the previous date tags:


exiftool -a -G1 -s -n -ee '-gps*' 2014-0622-1701-32.jpg
[GPS]           GPSLatitudeRef                  : N
[GPS]           GPSLatitude                     : 52.5219416666667
[GPS]           GPSLongitudeRef                 : E
[GPS]           GPSLongitude                    : 13.4125083333333
[GPS]           GPSAltitudeRef                  : 0
[GPS]           GPSAltitude                     : 46
[GPS]           GPSTimeStamp                    : 15:01:27.61
[GPS]           GPSImgDirectionRef              : T
[GPS]           GPSImgDirection                 : 232.1161826
[Composite]     GPSAltitude                     : 46
[Composite]     GPSLatitude                     : 52.5219416666667
[Composite]     GPSLongitude                    : 13.4125083333333
[Composite]     GPSPosition                     : 52.5219416666667 13.4125083333333


In that particular iPhone image the GPS:GPSTimeStamp caused the images that happened to have it to sort incorrectly among DSLR images shot 1 hour later without GPS (I add GPS to all images later but without that unnecessary GPS:GPSTimeStamp). DST and a different timezones were also flies in the ointment with this particular error.


Those subtle errors might be difficult to track but they can be fixed by mangling the offending metadata tags. I wish Photos.app had an easy to use GUI for this.

Dec 31, 2020 1:52 PM in response to Matti Haveri

OK so here are the exiftool results per your suggestion, for two of the files in question.  I ran this on the originals as copied from the CF card, Photos has not touched these yet.


So what is GPStimeStamp and where does it come from? Why is Photos using it? I see in the second example above the time is 12:26:12 and the GPSDateTime is 16:13:38Z. What does that mean? What is the Z?


exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all -api RequestAll=2 5DM40046.JPG

[ExifTool] Now : 2020:12:31 16:28:37-05:00

[System] FileModifyDate : 2020:12:31 12:24:52-05:00

[System] FileAccessDate : 2020:12:31 13:35:39-05:00

[System] FileInodeChangeDate : 2020:12:31 13:22:21-05:00

[IFD0] ModifyDate : 2020:12:31 12:24:52

[ExifIFD] DateTimeOriginal : 2020:12:31 12:24:52

[ExifIFD] CreateDate : 2020:12:31 12:24:52

[Canon] TimeZone : -04:00

[Canon] TimeZoneCity : New York

[Canon] DaylightSavings : On

[ExifIFD] SubSecTime : 00

[ExifIFD] SubSecTimeOriginal : 00

[ExifIFD] SubSecTimeDigitized : 00

[Composite] SubSecCreateDate : 2020:12:31 12:24:52.00

[Composite] SubSecDateTimeOriginal : 2020:12:31 12:24:52.00

[Composite] SubSecModifyDate : 2020:12:31 12:24:52.00

exiftool -a -G1 -s -n -ee '-gps*' 5DM40046.JPG

[GPS] GPSVersionID : 2 3 0 0

[GPS] GPSSatellites :

[GPS] GPSStatus : V

[GPS] GPSMapDatum : WGS-84


exiftool -a -G1 -s -api QuickTimeUTC=1 -time:all -api RequestAll=2 5DM40048.JPG

[ExifTool] Now : 2020:12:31 16:29:24-05:00

[System] FileModifyDate : 2020:12:31 12:26:12-05:00

[System] FileAccessDate : 2020:12:31 13:35:39-05:00

[System] FileInodeChangeDate : 2020:12:31 13:22:22-05:00

[IFD0] ModifyDate : 2020:12:31 12:26:12

[ExifIFD] DateTimeOriginal : 2020:12:31 12:26:12

[ExifIFD] CreateDate : 2020:12:31 12:26:12

[Canon] TimeZone : -04:00

[Canon] TimeZoneCity : New York

[Canon] DaylightSavings : On

[ExifIFD] SubSecTime : 95

[ExifIFD] SubSecTimeOriginal : 95

[ExifIFD] SubSecTimeDigitized : 95

[GPS] GPSTimeStamp : 16:13:38

[GPS] GPSDateStamp : 2020:12:31

[Composite] GPSDateTime : 2020:12:31 16:13:38Z

[Composite] SubSecCreateDate : 2020:12:31 12:26:12.95

[Composite] SubSecDateTimeOriginal : 2020:12:31 12:26:12.95

[Composite] SubSecModifyDate : 2020:12:31 12:26:12.95

exiftool -a -G1 -s -n -ee '-gps*' 5DM40048.JPG

[GPS] GPSVersionID : 2 3 0 0

[GPS] GPSLatitudeRef : N

[GPS] GPSLatitude : 40.31106

[GPS] GPSLongitudeRef : W

[GPS] GPSLongitude : 75.3169183333333

[GPS] GPSAltitudeRef : 0

[GPS] GPSAltitude : 189.2

[GPS] GPSTimeStamp : 16:13:38

[GPS] GPSSatellites : 5

[GPS] GPSStatus : A

[GPS] GPSMeasureMode : 3

[GPS] GPSDOP : 4.7

[GPS] GPSMapDatum : WGS-84

[GPS] GPSDateStamp : 2020:12:31

[Composite] GPSAltitude : 189.2

[Composite] GPSDateTime : 2020:12:31 16:13:38Z

[Composite] GPSLatitude : 40.31106

[Composite] GPSLongitude : -75.3169183333333

[Composite] GPSPosition : 40.31106 -75.3169183333333

Dec 31, 2020 2:29 PM in response to bprice

A few other things I learned from


https://photo.stackexchange.com/questions/77973/when-exactly-is-gpstimestamp

and

https://medium.com/@lowply/how-to-fix-a-gps-time-stamp-bug-8d8d7584e004


are that Z at the end of the GPS Time Stamp just means UTC (Time Zone 0), and also that GPS Time Stamp is not a proper metadata for determining when a photo was taken, so Apple should not be using it to determine anything about chronological sorting of photos. GPS Time Stamp is apparently the last time the GPS coordinates were confirmed. With my sample batch of photos, this checks out. The first few photos had no GPS information, and were the ones actually sorted CORRECTLY when importing into Photos, since Photos just used DateTimeOriginal of 12:25:12 and the Time Zone information of my Mac. The other photos appeared earlier in the sort, but that's because the camera GPS finally got a signal and the GPS Time Stamp was 16:13:13 UTC (which is 5 hours ahead, so the photos show as 11:13:13 in the Photos sorting.) So why is Apple erroneously preferring the GPS Time Stamp (with correction for time zone) instead of the Exif DateTimeOriginal? It can only be a bug, or bad code. If I had to guess I'd say it's likely because the only "camera" Apple makes and cares about is the iPhone, which has a very very reliable GPS system. So this problem of a GPS Time Stamp that is occasionally "stale" never crops up within the Apple ecosystem. So my solution will be to dumb down my expensive DSLR and turn off GPS. So ridiculous.

Jan 1, 2021 1:38 AM in response to bprice

You have found good links, thanks! So it seems in addition to a different timezone, the occasional GPS:GPSTimeStamp or even if it happens to have decimals between 59.996 to 59.999 (!) can cause incorrect sorting in Photos.


I don't know what is the best way to fix this. You could nuke the GPS:GPSTimeStamp from all files in a folder with the following command. But I would not do such a destructive edit lightly (I have archived some such original images before editing metadata just in case).


exiftool -GPS:GPSTimeStamp= .


Sometimes also a seemingly correct ExifIFD:DateTimeOriginal date is interpreted wrong in Photos and Google Photos (both show the time as 0.00.00 and sort the image at midnight. The cause for this was that IPTC:DateCreated exist, but the matching IPTC:TimeCreated do not). GraphicConverter 11.2.2 "Copy Exif Date to all other Metadata Dates" command fixed this error. I first filtered the numerous offending files to a new folder with this command:


exiftool -if '$IPTC:DateCreated and not $IPTC:TimeCreated' -Directory=/path/to/questionables/ /path/to/source


It has also been reported that if there are many EXIF, IPTC or XMP tags having different information, many apps randomly get the info from any tag they happen to see first (well behaving apps should synchronise edits to all relevant tags but this does not always happen).


And AFAIR the results vary depending in which timezone the computer happens to be when importing the files to Photos. Or which date tag is used (that Z in some files shot in London seemed to affect sorting between images and between some movies. Images use local time and movies should use UTC and there are many tags where the movie date might happen to be).


And different versions of Photos also use different sorting algorithms so re-importing the same files produces different sorting.


So many variables sometimes make troubleshooting a nightmare.


Apple's quality control has not been very good in some areas like this although it otherwise pays much attention to little details. Please send feedback so maybe this is fixed:


https://www.apple.com/feedback/

Jan 1, 2021 12:12 PM in response to Matti Haveri

Feedback submitted (as detailed as I could given the character limit.)

It's unclear to me if this problem is fixed or improved in any way for Photos versions 5 or 6 (Big Sur.) I wish Apple didn't tie application versions to the OS versions like they do. Anyway, I am stuck on Mojave since I'm using 2012 Mac Pro (don't pity me, it's tricked out such that benchmarks show it's comparable to 2018-era Macs or better.) I am in the process of planning a migration to a 2013 Mac Pro model (bought in 2017) which will allow me to go at least up to Big Sur (who knows after that.)

Chronological Sorting photos in Apple Photos incorrectly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.