simulot / immich-go

An alternative to the immich-CLI command that doesn't depend on nodejs installation. It tries its best for importing google photos takeout archives.
GNU Affero General Public License v3.0
1.91k stars 55 forks source link

Wrong time after upload #488

Open people-rus opened 2 months ago

people-rus commented 2 months ago

When I import a photo saved on my PC, the time zone is lost when loading and because of this the loaded photo has an incorrect time, in my case +3 hours. I run the server and import on Windows. Screenshot_1 I tried different scenarios:

simulot commented 2 months ago

That's a known problem In the current version, immich-go takes the date of capture from the file name, in UTC. That's finally not a good idea, some smart phone manufacturers use UTC, while other use local time as yours.

I'll turn off by default this feature in the next major release.

raidolo commented 1 month ago

I can add that I have the same problem.

 INFO | scanned image file | file=2024-10-08_13-22-37_373.heic time="2024-10-10T10:09.58 CEST"
 INFO | uploaded | file=2024-10-08_13-22-37_373.heic "capture date"="2024-10-08 13:22:37 +0000 UTC" time="2024-10-10T10:09.59 CEST"
 INFO |

The photo was taken with and OffsetTime of +2:00 from UTC

image

Uploading with immich-cli use the correct dates.

Would it possible to manage the OffsetTime exif data in immich-go?

raidolo commented 1 month ago

I think it's more complex than that, cause I have other photos for which immich-go uploaded the date correctly. The foto I mentioned in the comment before was download from Amazon Photo, which I use to currently backup my iphone photos.

This is the complete exif of the foto downloaded from Amazon: The correct date should be 2024:10:08 13:22:37+02:00 Instead I got 15:22 +2:00 in immich at the end because it was uploaded with +000UTC and then immich applies my timezone +2:00

Log was this:

 INFO | scanned image file | file=2024-10-08_13-22-37_373.heic time="2024-10-10T10:09.58 CEST"
 INFO | uploaded | file=2024-10-08_13-22-37_373.heic "capture date"="2024-10-08 13:22:37 +0000 UTC" time="2024-10-10T10:09.59 CEST"
 INFO |

This is its exif data:

---- ExifTool ----
ExifTool Version Number         : 12.98
---- File ----
File Name                       : 2024-10-08_13-22-37_373.heic
Directory                       : .
File Size                       : 2.7 MB
File Modification Date/Time     : 2024:10:08 17:22:30+02:00
File Access Date/Time           : 2024:10:10 11:02:41+02:00
File Creation Date/Time         : 2024:10:10 10:51:13+02:00
File Permissions                : -rw-rw-rw-
File Type                       : HEIC
File Type Extension             : heic
MIME Type                       : image/heic
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Width                     : 4032
Image Height                    : 3024
---- QuickTime ----
Major Brand                     : High Efficiency Image Format HEVC still image (.HEIC)
Minor Version                   : 0.0.0
Compatible Brands               : mif1*MiHE*MiPr*miaf*MiHB*heic
Handler Type                    : Picture
Primary Item Reference          : 49
Meta Image Size                 : 4032x3024
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 90 (level 3.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 512x512
Image Spatial Extent            : 4032x3024
Rotation                        : Horizontal (Normal)
Image Pixel Depth               : 8 8 8
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 60 (level 2.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 320x240
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Format Range Extensions
Gen Profile Compatibility Flags : Format Range Extensions
Constraint Indicator Flags      : 191 200 0 0 0 0
General Level IDC               : 150 (level 5.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : Monochrome
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 2016x1512
Image Pixel Depth               : 8
Auxiliary Image Type            : urn:com:apple:photo:2020:aux:hdrgainmap
Media Data Size                 : 2739627
Media Data Offset               : 3752
---- XMP ----
XMP Toolkit                     : XMP Core 6.0.0
HDR Gain Map Version            : 65536
---- EXIF ----
Make                            : Apple
Camera Model Name               : iPhone 13
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 17.6.1
Modify Date                     : 2024:10:08 13:22:37
Host Computer                   : iPhone 13
Exposure Time                   : 1/50
F Number                        : 1.6
Exposure Program                : Program AE
ISO                             : 250
Exif Version                    : 0232
Date/Time Original              : 2024:10:08 13:22:37
Create Date                     : 2024:10:08 13:22:37
Offset Time                     : +02:00
Offset Time Original            : +02:00
Offset Time Digitized           : +02:00
Shutter Speed Value             : 1/50
Aperture Value                  : 1.6
Brightness Value                : 1.127962058
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire
Focal Length                    : 5.1 mm
Subject Area                    : 2007 1505 2213 1324
Sub Sec Time Original           : 373
Sub Sec Time Digitized          : 373
Color Space                     : Uncalibrated
Exif Image Width                : 4032
Exif Image Height               : 3024
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 26 mm
Lens Info                       : 1.539999962-5.1mm f/1.6-2.4
Lens Make                       : Apple
Lens Model                      : iPhone 13 back dual wide camera 5.1mm f/1.6
Composite Image                 : General Composite Image
---- MakerNotes ----
Maker Note Version              : 14
Run Time Flags                  : Valid
Run Time Value                  : 473676964273208
Run Time Scale                  : 1000000000
Run Time Epoch                  : 0
AE Stable                       : No
AE Target                       : 171
AE Average                      : 172
AF Stable                       : Yes
Acceleration Vector             : -0.9636065361 0.03810524941 -0.2485933603
Focus Distance Range            : 1.30 - 2.27 m
Image Capture Type              : Scene
Live Photo Video Index          : 1112547328
Photos App Feature Flags        : 0
HDR Headroom                    : 0.8432090282
AF Performance                  : 101 1 39
Signal To Noise Ratio           : 34.40991211
Photo Identifier                : 6AA4934A-AAB5-4590-A54B-3FBB201E6071
Color Temperature               : 3984
Camera Type                     : Back Normal
Focus Position                  : 48
HDR Gain                        : 0
Semantic Style                  : {_0=1,_1=0,_2=0,_3=0}
---- ICC_Profile ----
Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2022:01:01 00:00:00
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Apple Computer Inc.
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.
Profile ID                      : ecfda38e388547c36db4bd4f7ada182f
Profile Description             : Display P3
Profile Copyright               : Copyright Apple Inc., 2022
Media White Point               : 0.96419 1 0.82489
Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01508 0.75168
Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
---- Composite ----
Run Time Since Power Up         : 5 days 11:34:37
Aperture                        : 1.6
Image Size                      : 4032x3024
Megapixels                      : 12.2
Scale Factor To 35 mm Equivalent: 5.1
Shutter Speed                   : 1/50
Create Date                     : 2024:10:08 13:22:37.373+02:00
Date/Time Original              : 2024:10:08 13:22:37.373+02:00
Modify Date                     : 2024:10:08 13:22:37+02:00
Circle Of Confusion             : 0.006 mm
Field Of View                   : 69.4 deg
Focal Length                    : 5.1 mm (35 mm equivalent: 26.0 mm)
Hyperfocal Distance             : 2.76 m
Light Value                     : 5.7
Lens ID                         : iPhone 13 back dual wide camera 5.1mm f/1.6

Then I've checked the import I've done from the photo backup of my wife's Phone, directly copied to my Synology file with DS Files, so it's basically the original file (not uploaded elsewhere in Amazon). An it was uploaded with this log from immich-go:

INFO | uploaded | file=IMG_3548_1.HEIC "capture date"="2024-09-28 21:35:10 +0200 CEST" time="2024-10-07T11:43.56 CEST"

In Immich I correctly see the date 21:35:10 +2:00

This is its complete exif:


---- ExifTool ----
ExifTool Version Number         : 12.98
---- File ----
File Name                       : IMG_3548_1.HEIC
Directory                       : .
File Size                       : 1664 kB
Zone Identifier                 : Exists
File Modification Date/Time     : 2024:09:28 21:35:10+02:00
File Access Date/Time           : 2024:10:10 11:09:09+02:00
File Creation Date/Time         : 2024:10:10 10:57:13+02:00
File Permissions                : -rw-rw-rw-
File Type                       : HEIC
File Type Extension             : heic
MIME Type                       : image/heic
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Width                     : 4032
Image Height                    : 3024
---- QuickTime ----
Major Brand                     : High Efficiency Image Format HEVC still image (.HEIC)
Minor Version                   : 0.0.0
Compatible Brands               : mif1*MiHE*MiPr*miaf*MiHB*heic
Handler Type                    : Picture
Primary Item Reference          : 49
Meta Image Size                 : 4032x3024
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 90 (level 3.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 512x512
Image Spatial Extent            : 4032x3024
Rotation                        : Horizontal (Normal)
Image Pixel Depth               : 8 8 8
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 60 (level 2.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 320x240
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Format Range Extensions
Gen Profile Compatibility Flags : Format Range Extensions
Constraint Indicator Flags      : 191 200 0 0 0 0
General Level IDC               : 150 (level 5.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : Monochrome
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 1
Temporal ID Nested              : No
Image Spatial Extent            : 2016x1512
Image Pixel Depth               : 8
Auxiliary Image Type            : urn:com:apple:photo:2020:aux:hdrgainmap
Media Data Size                 : 1659195
Media Data Offset               : 4757
---- XMP ----
XMP Toolkit                     : XMP Core 6.0.0
HDR Gain Map Version            : 65536
Create Date                     : 2024:09:28 21:35:10
Creator Tool                    : 17.6.1
Modify Date                     : 2024:09:28 21:35:10
Region Area Y                   : 0.57300000000000006*0.30049999999999999
Region Area W                   : 0.16300000000000003*0.20299999999999996
Region Area X                   : 0.46650000000000003*0.75350000000000006
Region Area H                   : 0.21800000000000003*0.27100000000000002
Region Area Unit                : normalized*normalized
Region Type                     : Face*Face
Region Extensions Angle Info Yaw: 5
Region Extensions Angle Info Roll: 4
Region Extensions Confidence Level: 653
Region Extensions Face ID       : 6
Region Extensions Angle Info Yaw: 349
Region Extensions Angle Info Roll: 345
Region Extensions Confidence Level: 580
Region Extensions Face ID       : 3
Region Applied To Dimensions H  : 3024
Region Applied To Dimensions W  : 4032
Region Applied To Dimensions Unit: pixel
Date Created                    : 2024:09:28 21:35:10
---- EXIF ----
Make                            : Apple
Camera Model Name               : iPhone 13 mini
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 17.6.1
Modify Date                     : 2024:09:28 21:35:10
Host Computer                   : iPhone 13 mini
Exposure Time                   : 1/15
F Number                        : 2.2
Exposure Program                : Program AE
ISO                             : 1000
Exif Version                    : 0232
Date/Time Original              : 2024:09:28 21:35:10
Create Date                     : 2024:09:28 21:35:10
Offset Time                     : +02:00
Offset Time Original            : +02:00
Offset Time Digitized           : +02:00
Shutter Speed Value             : 1/15
Aperture Value                  : 2.2
Brightness Value                : -1.417190818
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire
Focal Length                    : 2.7 mm
Sub Sec Time Original           : 187
Sub Sec Time Digitized          : 187
Color Space                     : Uncalibrated
Exif Image Width                : 4032
Exif Image Height               : 3024
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 23 mm
Lens Info                       : 2.71mm f/2.2
Lens Make                       : Apple
Lens Model                      : iPhone 13 mini front camera 2.71mm f/2.2
Composite Image                 : General Composite Image
---- MakerNotes ----
Maker Note Version              : 14
Run Time Flags                  : Valid
Run Time Value                  : 1061155076704958
Run Time Scale                  : 1000000000
Run Time Epoch                  : 0
AE Stable                       : Yes
AE Target                       : 220
AE Average                      : 189
AF Stable                       : Yes
Acceleration Vector             : 0.9834319352 0.08910301331 -0.09820717576
Image Capture Type              : Scene
Live Photo Video Index          : 1111498752
Photos App Feature Flags        : 0
HDR Headroom                    : 0.5
Signal To Noise Ratio           : 18.64754677
Photo Identifier                : 1D556A97-4F4F-4531-9245-D495A53ECF76
Color Temperature               : 3934
Camera Type                     : Back Wide Angle
Focus Position                  : 0
HDR Gain                        : 0.0128531931
Semantic Style                  : {_0=1,_1=0,_2=0,_3=0}
---- ICC_Profile ----
Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2022:01:01 00:00:00
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Apple Computer Inc.
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.
Profile ID                      : ecfda38e388547c36db4bd4f7ada182f
Profile Description             : Display P3
Profile Copyright               : Copyright Apple Inc., 2022
Media White Point               : 0.96419 1 0.82489
Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01508 0.75168
Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
---- Composite ----
Run Time Since Power Up         : 12 days 6:45:55
Aperture                        : 2.2
Image Size                      : 4032x3024
Megapixels                      : 12.2
Scale Factor To 35 mm Equivalent: 8.5
Shutter Speed                   : 1/15
Create Date                     : 2024:09:28 21:35:10.187+02:00
Date/Time Original              : 2024:09:28 21:35:10.187+02:00
Modify Date                     : 2024:09:28 21:35:10+02:00
Circle Of Confusion             : 0.004 mm
Field Of View                   : 76.1 deg
Focal Length                    : 2.7 mm (35 mm equivalent: 23.0 mm)
Hyperfocal Distance             : 0.94 m
Light Value                     : 2.9
Lens ID                         : iPhone 13 mini front camera 2.71mm f/2.2

I've compared the exifs with sdiff but the dates look to have similar format to me... Why such difference?

Thanks!

raidolo commented 1 month ago

Hi @simulot,

I've found the issue for my case and possibily also for @people-rus.

It's the filename that tricks immich-go. it seems that if you have a filename with dates/timestamps, immich-go ignores the exif data. Is it possibile?

Proofs: I've compared the exifs from the file from Amazon Photos and the Original file from my phone. They are the same, but immich-go correctly sees the CEST timezone for the original and instead it makes a mistake with the file from Amazon.

Look at this: IMG_4932 is the original file from my phone uploaded to my NAS directly, the other is the file downloaded from Amazon named with the capture date timestamp:


$ sdiff --width 200 IMG_4932.txt  2024-10-08_13-22-37_373.txt

---- ExifTool ----                                                                                      ---- ExifTool ----
ExifTool Version Number         : 12.98                                                                 ExifTool Version Number         : 12.98
---- File ----                                                                                          ---- File ----
File Name                       : IMG_4932.heic                                                    |    File Name                       : 2024-10-08_13-22-37_373.heic
Directory                       : .                                                                     Directory                       : .
File Size                       : 2.7 MB                                                                File Size                       : 2.7 MB
File Modification Date/Time     : 2024:10:10 15:08:20+02:00                                        |    File Modification Date/Time     : 2024:10:10 15:08:31+02:00
File Access Date/Time           : 2024:10:10 15:10:11+02:00                                        |    File Access Date/Time           : 2024:10:10 15:10:06+02:00
File Creation Date/Time         : 2024:10:10 15:08:18+02:00                                        |    File Creation Date/Time         : 2024:10:10 15:08:29+02:00
File Permissions                : -rw-rw-rw-                                                            File Permissions                : -rw-rw-rw-
File Type                       : HEIC                                                                  File Type                       : HEIC
File Type Extension             : heic                                                                  File Type Extension             : heic
MIME Type                       : image/heic                                                            MIME Type                       : image/heic
Exif Byte Order                 : Big-endian (Motorola, MM)                                             Exif Byte Order                 : Big-endian (Motorola, MM)
Image Width                     : 4032                                                                  Image Width                     : 4032
Image Height                    : 3024                                                                  Image Height                    : 3024
---- QuickTime ----                                                                                     ---- QuickTime ----
Major Brand                     : High Efficiency Image Format HEVC still image (.HEIC)                 Major Brand                     : High Efficiency Image Format HEVC still image (.HEIC)
Minor Version                   : 0.0.0                                                                 Minor Version                   : 0.0.0
Compatible Brands               : mif1*MiHE*MiPr*miaf*MiHB*heic                                         Compatible Brands               : mif1*MiHE*MiPr*miaf*MiHB*heic
Handler Type                    : Picture                                                               Handler Type                    : Picture
Primary Item Reference          : 49                                                                    Primary Item Reference          : 49
Meta Image Size                 : 4032x3024                                                             Meta Image Size                 : 4032x3024
HEVC Configuration Version      : 1                                                                     HEVC Configuration Version      : 1
General Profile Space           : Conforming                                                            General Profile Space           : Conforming
General Tier Flag               : Main Tier                                                             General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture                                                    General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main                                     Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0                                                         Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 90 (level 3.0)                                                        General Level IDC               : 90 (level 3.0)
Min Spatial Segmentation IDC    : 0                                                                     Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0                                                                     Parallelism Type                : 0
Chroma Format                   : 4:2:0                                                                 Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8                                                                     Bit Depth Luma                  : 8
Bit Depth Chroma                : 8                                                                     Bit Depth Chroma                : 8
Average Frame Rate              : 0                                                                     Average Frame Rate              : 0
Constant Frame Rate             : Unknown                                                               Constant Frame Rate             : Unknown
Num Temporal Layers             : 1                                                                     Num Temporal Layers             : 1
Temporal ID Nested              : No                                                                    Temporal ID Nested              : No
Image Spatial Extent            : 512x512                                                               Image Spatial Extent            : 512x512
Image Spatial Extent            : 4032x3024                                                             Image Spatial Extent            : 4032x3024
Rotation                        : Horizontal (Normal)                                                   Rotation                        : Horizontal (Normal)
Image Pixel Depth               : 8 8 8                                                                 Image Pixel Depth               : 8 8 8
HEVC Configuration Version      : 1                                                                     HEVC Configuration Version      : 1
General Profile Space           : Conforming                                                            General Profile Space           : Conforming
General Tier Flag               : Main Tier                                                             General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture                                                    General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main                                     Gen Profile Compatibility Flags : Main Still Picture, Main 10, Main
Constraint Indicator Flags      : 176 0 0 0 0 0                                                         Constraint Indicator Flags      : 176 0 0 0 0 0
General Level IDC               : 60 (level 2.0)                                                        General Level IDC               : 60 (level 2.0)
Min Spatial Segmentation IDC    : 0                                                                     Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0                                                                     Parallelism Type                : 0
Chroma Format                   : 4:2:0                                                                 Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8                                                                     Bit Depth Luma                  : 8
Bit Depth Chroma                : 8                                                                     Bit Depth Chroma                : 8
Average Frame Rate              : 0                                                                     Average Frame Rate              : 0
Constant Frame Rate             : Unknown                                                               Constant Frame Rate             : Unknown
Num Temporal Layers             : 1                                                                     Num Temporal Layers             : 1
Temporal ID Nested              : No                                                                    Temporal ID Nested              : No
Image Spatial Extent            : 320x240                                                               Image Spatial Extent            : 320x240
HEVC Configuration Version      : 1                                                                     HEVC Configuration Version      : 1
General Profile Space           : Conforming                                                            General Profile Space           : Conforming
General Tier Flag               : Main Tier                                                             General Tier Flag               : Main Tier
General Profile IDC             : Format Range Extensions                                               General Profile IDC             : Format Range Extensions
Gen Profile Compatibility Flags : Format Range Extensions                                               Gen Profile Compatibility Flags : Format Range Extensions
Constraint Indicator Flags      : 191 200 0 0 0 0                                                       Constraint Indicator Flags      : 191 200 0 0 0 0
General Level IDC               : 150 (level 5.0)                                                       General Level IDC               : 150 (level 5.0)
Min Spatial Segmentation IDC    : 0                                                                     Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0                                                                     Parallelism Type                : 0
Chroma Format                   : Monochrome                                                            Chroma Format                   : Monochrome
Bit Depth Luma                  : 8                                                                     Bit Depth Luma                  : 8
Bit Depth Chroma                : 8                                                                     Bit Depth Chroma                : 8
Average Frame Rate              : 0                                                                     Average Frame Rate              : 0
Constant Frame Rate             : Unknown                                                               Constant Frame Rate             : Unknown
Num Temporal Layers             : 1                                                                     Num Temporal Layers             : 1
Temporal ID Nested              : No                                                                    Temporal ID Nested              : No
Image Spatial Extent            : 2016x1512                                                             Image Spatial Extent            : 2016x1512
Image Pixel Depth               : 8                                                                     Image Pixel Depth               : 8
Auxiliary Image Type            : urn:com:apple:photo:2020:aux:hdrgainmap                               Auxiliary Image Type            : urn:com:apple:photo:2020:aux:hdrgainmap
Media Data Size                 : 2739627                                                               Media Data Size                 : 2739627
Media Data Offset               : 3752                                                                  Media Data Offset               : 3752
---- XMP ----                                                                                           ---- XMP ----
XMP Toolkit                     : XMP Core 6.0.0                                                        XMP Toolkit                     : XMP Core 6.0.0
HDR Gain Map Version            : 65536                                                                 HDR Gain Map Version            : 65536
---- EXIF ----                                                                                          ---- EXIF ----
Make                            : Apple                                                                 Make                            : Apple
Camera Model Name               : iPhone 13                                                             Camera Model Name               : iPhone 13
Orientation                     : Horizontal (normal)                                                   Orientation                     : Horizontal (normal)
X Resolution                    : 72                                                                    X Resolution                    : 72
Y Resolution                    : 72                                                                    Y Resolution                    : 72
Resolution Unit                 : inches                                                                Resolution Unit                 : inches
Software                        : 17.6.1                                                                Software                        : 17.6.1
Modify Date                     : 2024:10:08 13:22:37                                                   Modify Date                     : 2024:10:08 13:22:37
Host Computer                   : iPhone 13                                                             Host Computer                   : iPhone 13
Exposure Time                   : 1/50                                                                  Exposure Time                   : 1/50
F Number                        : 1.6                                                                   F Number                        : 1.6
Exposure Program                : Program AE                                                            Exposure Program                : Program AE
ISO                             : 250                                                                   ISO                             : 250
Exif Version                    : 0232                                                                  Exif Version                    : 0232
Date/Time Original              : 2024:10:08 13:22:37                                                   Date/Time Original              : 2024:10:08 13:22:37
Create Date                     : 2024:10:08 13:22:37                                                   Create Date                     : 2024:10:08 13:22:37
Offset Time                     : +02:00                                                                Offset Time                     : +02:00
Offset Time Original            : +02:00                                                                Offset Time Original            : +02:00
Offset Time Digitized           : +02:00                                                                Offset Time Digitized           : +02:00
Shutter Speed Value             : 1/50                                                                  Shutter Speed Value             : 1/50
Aperture Value                  : 1.6                                                                   Aperture Value                  : 1.6
Brightness Value                : 1.127962058                                                           Brightness Value                : 1.127962058
Exposure Compensation           : 0                                                                     Exposure Compensation           : 0
Metering Mode                   : Multi-segment                                                         Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire                                                     Flash                           : Off, Did not fire
Focal Length                    : 5.1 mm                                                                Focal Length                    : 5.1 mm
Subject Area                    : 2007 1505 2213 1324                                                   Subject Area                    : 2007 1505 2213 1324
Sub Sec Time Original           : 373                                                                   Sub Sec Time Original           : 373
Sub Sec Time Digitized          : 373                                                                   Sub Sec Time Digitized          : 373
Color Space                     : Uncalibrated                                                          Color Space                     : Uncalibrated
Exif Image Width                : 4032                                                                  Exif Image Width                : 4032
Exif Image Height               : 3024                                                                  Exif Image Height               : 3024
Sensing Method                  : One-chip color area                                                   Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed                                                 Scene Type                      : Directly photographed
Exposure Mode                   : Auto                                                                  Exposure Mode                   : Auto
White Balance                   : Auto                                                                  White Balance                   : Auto
Focal Length In 35mm Format     : 26 mm                                                                 Focal Length In 35mm Format     : 26 mm
Lens Info                       : 1.539999962-5.1mm f/1.6-2.4                                           Lens Info                       : 1.539999962-5.1mm f/1.6-2.4
Lens Make                       : Apple                                                                 Lens Make                       : Apple
Lens Model                      : iPhone 13 back dual wide camera 5.1mm f/1.6                           Lens Model                      : iPhone 13 back dual wide camera 5.1mm f/1.6
Composite Image                 : General Composite Image                                               Composite Image                 : General Composite Image
---- MakerNotes ----                                                                                    ---- MakerNotes ----
Maker Note Version              : 14                                                                    Maker Note Version              : 14
Run Time Flags                  : Valid                                                                 Run Time Flags                  : Valid
Run Time Value                  : 473676964273208                                                       Run Time Value                  : 473676964273208
Run Time Scale                  : 1000000000                                                            Run Time Scale                  : 1000000000
Run Time Epoch                  : 0                                                                     Run Time Epoch                  : 0
AE Stable                       : No                                                                    AE Stable                       : No
AE Target                       : 171                                                                   AE Target                       : 171
AE Average                      : 172                                                                   AE Average                      : 172
AF Stable                       : Yes                                                                   AF Stable                       : Yes
Acceleration Vector             : -0.9636065361 0.03810524941 -0.2485933603                             Acceleration Vector             : -0.9636065361 0.03810524941 -0.2485933603
Focus Distance Range            : 1.30 - 2.27 m                                                         Focus Distance Range            : 1.30 - 2.27 m
Image Capture Type              : Scene                                                                 Image Capture Type              : Scene
Live Photo Video Index          : 1112547328                                                            Live Photo Video Index          : 1112547328
Photos App Feature Flags        : 0                                                                     Photos App Feature Flags        : 0
HDR Headroom                    : 0.8432090282                                                          HDR Headroom                    : 0.8432090282
AF Performance                  : 101 1 39                                                              AF Performance                  : 101 1 39
Signal To Noise Ratio           : 34.40991211                                                           Signal To Noise Ratio           : 34.40991211
Photo Identifier                : 6AA4934A-AAB5-4590-A54B-3FBB201E6071                                  Photo Identifier                : 6AA4934A-AAB5-4590-A54B-3FBB201E6071
Color Temperature               : 3984                                                                  Color Temperature               : 3984
Camera Type                     : Back Normal                                                           Camera Type                     : Back Normal
Focus Position                  : 48                                                                    Focus Position                  : 48
HDR Gain                        : 0                                                                     HDR Gain                        : 0
Semantic Style                  : {_0=1,_1=0,_2=0,_3=0}                                                 Semantic Style                  : {_0=1,_1=0,_2=0,_3=0}
---- ICC_Profile ----                                                                                   ---- ICC_Profile ----
Profile CMM Type                : Apple Computer Inc.                                                   Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 4.0.0                                                                 Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile                                                Profile Class                   : Display Device Profile
Color Space Data                : RGB                                                                   Color Space Data                : RGB
Profile Connection Space        : XYZ                                                                   Profile Connection Space        : XYZ
Profile Date Time               : 2022:01:01 00:00:00                                                   Profile Date Time               : 2022:01:01 00:00:00
Profile File Signature          : acsp                                                                  Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.                                                   Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent                                             CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Apple Computer Inc.                                                   Device Manufacturer             : Apple Computer Inc.
Device Model                    :                                                                       Device Model                    :
Device Attributes               : Reflective, Glossy, Positive, Color                                   Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual                                                            Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491                                                      Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.                                                   Profile Creator                 : Apple Computer Inc.
Profile ID                      : ecfda38e388547c36db4bd4f7ada182f                                      Profile ID                      : ecfda38e388547c36db4bd4f7ada182f
Profile Description             : Display P3                                                            Profile Description             : Display P3
Profile Copyright               : Copyright Apple Inc., 2022                                            Profile Copyright               : Copyright Apple Inc., 2022
Media White Point               : 0.96419 1 0.82489                                                     Media White Point               : 0.96419 1 0.82489
Red Matrix Column               : 0.51512 0.2412 -0.00105                                               Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189                                               Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407                                                Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)                      Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01        Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01
Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)                      Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)                      Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
---- Composite ----                                                                                     ---- Composite ----
Run Time Since Power Up         : 5 days 11:34:37                                                       Run Time Since Power Up         : 5 days 11:34:37
Aperture                        : 1.6                                                                   Aperture                        : 1.6
Image Size                      : 4032x3024                                                             Image Size                      : 4032x3024
Megapixels                      : 12.2                                                                  Megapixels                      : 12.2
Scale Factor To 35 mm Equivalent: 5.1                                                                   Scale Factor To 35 mm Equivalent: 5.1
Shutter Speed                   : 1/50                                                                  Shutter Speed                   : 1/50
Create Date                     : 2024:10:08 13:22:37.373+02:00                                         Create Date                     : 2024:10:08 13:22:37.373+02:00
Date/Time Original              : 2024:10:08 13:22:37.373+02:00                                         Date/Time Original              : 2024:10:08 13:22:37.373+02:00
Modify Date                     : 2024:10:08 13:22:37+02:00                                             Modify Date                     : 2024:10:08 13:22:37+02:00
Circle Of Confusion             : 0.006 mm                                                              Circle Of Confusion             : 0.006 mm
Field Of View                   : 69.4 deg                                                              Field Of View                   : 69.4 deg
Focal Length                    : 5.1 mm (35 mm equivalent: 26.0 mm)                                    Focal Length                    : 5.1 mm (35 mm equivalent: 26.0 mm)
Hyperfocal Distance             : 2.76 m                                                                Hyperfocal Distance             : 2.76 m
Light Value                     : 5.7                                                                   Light Value                     : 5.7
Lens ID                         : iPhone 13 back dual wide camera 5.1mm f/1.6                           Lens ID                         : iPhone 13 back dual wide camera 5.1mm f/1.6

This is the output from a immich-go dry-run:

 INFO | uploaded | file=IMG_4932.heic "capture date"="2024-10-08 13:22:37 +0200 CEST" time="2024-10-10T03:20.47 CEST"
 INFO | uploaded | file=2024-10-08_13-22-37_373.heic "capture date"="2024-10-08 13:22:37 +0000 UTC" time="2024-10-10T03:20.47 CEST"

THEN, I realized that one filename has the date in it, so I renamed the file from Amazon with the date to "test.heic" and boom..... no more mistakes:

│ INFO | uploaded | file=IMG_4932.heic "capture date"="2024-10-08 13:22:37 +0200 CEST" time="2024-10-10T03:24.11 CEST"                                                                                                                                                                                                       │
│ INFO | uploaded | file=test.heic "capture date"="2024-10-08 13:22:37 +0200 CEST" time="2024-10-10T03:24.11 CEST"

Hope that helps!

Cheers.

raidolo commented 1 month ago

I believe these are the lines that have impactred this "bug", immich-go uses the full path to take the time FIRST!!!

https://github.com/simulot/immich-go/blob/7ee54ba2b7b7f84b2e2e2ebc5c15de8bb5383bac/browser/files/localassets.go#L280-L300

simulot commented 1 month ago

That's a known problem In the current version, immich-go takes the date of capture from the file name, in UTC. That's finally not a good idea, some smart phone manufacturers use UTC, while other use local time as yours.

I'll turn off by default this feature in the next major release.

This version isn't ready for the prime time. However you can give it a try here: https://github.com/simulot/immich-go/releases/tag/v1.0.0-alpha1

raidolo commented 1 month ago

This version isn't ready for the prime time. However you can give it a try here: https://github.com/simulot/immich-go/releases/tag/v1.0.0-alpha1

This version without specifing too much additional options like the "--capture-date-method " works fine with the filename as a timestamp. The date is correct.

image

I'm experimenting also with the --device-uuid, but the Immich app on my iPhone sees always a Remainder asset to be backed up... I've checked with the API that the asset device uuid is correctly applied in the database tough... but that's for another topic I believe.
Cheers.

simulot commented 1 month ago

Another alpha version: https://github.com/simulot/immich-go/releases/tag/v0.23.0-alpha2

raidolo commented 1 month ago

Another alpha version: https://github.com/simulot/immich-go/releases/tag/v0.23.0-alpha2

I've uploaded yesterday nearly 27k assets with 1.0.0-alpha1, I got not issues with the timestamps, just for your reference. What's changed in 0.23.0-alpha2?

image