Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date of capture issues with different time zones #397

Open
KrDw9ec4 opened this issue Jul 20, 2024 · 16 comments
Open

Date of capture issues with different time zones #397

KrDw9ec4 opened this issue Jul 20, 2024 · 16 comments

Comments

@KrDw9ec4
Copy link

First of all, thank you for developing immich-go, which helped me a lot to start using immich.

Here is my usage situation:

I am importing photos from a directory and the capture date works fine.

But since I live in GMT+8:00, the date in the photo file name also corresponds to GMT+8:00.

I checked the log file and found capture date"="2022-08-23 14:23:39 +0000 UTC", but I looked through the README and there was no configuration for setting the time zone.

INFO | uploaded | file=202208/IMG_20220823_142339.jpg "capture date"="2022-08-23 14:23:39 +0000 UTC" time="2024-07-21T01:41.08 CST"
 INFO | added to an album | file=202208/IMG_20220823_142339.jpg album=Camera reason="option -album" time="2024-07-21T01:41.08 CST"
@simulot
Copy link
Owner

simulot commented Jul 20, 2024

Are you importing a google takeout archive?
What is your time zone?

@KrDw9ec4
Copy link
Author

KrDw9ec4 commented Jul 21, 2024

Are you importing a google takeout archive? What is your time zone?

No. Asia/Shanghai(GMT +8).

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

Linux? Windows? MacOS?

@KrDw9ec4
Copy link
Author

Linux? Windows? MacOS?

Windows

@KrDw9ec4
Copy link
Author

KrDw9ec4 commented Jul 21, 2024

This problem seems to occur when the date is captured from Photo's file name: ex PXL_20220909_154515546.jpg
I found that if it cannot capture from the file name, it can identify the correct time zone from the Photo's exif data.

image

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

The system tries to guess the date of capture without reading its content, based on the name of the file or on its full path.

In the first screen shot, the date is taken from the file name: IMG_20230925_165908.jpg.
It uses UTC because my own phones are using UTC for naming the files.

In the second screen shot, the name isn't not enough to infer the date. So the file is read to file the relevant info.

@KrDw9ec4
Copy link
Author

It uses UTC because my own phones are using UTC for naming the files.

But in my country, phones usually use the local time zone :(

Is it possible to add a configuration to set the time zone?

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

Its a google Pixel... all UTC, in USA as well... surely the same in China.
So we have a problem...

Could you run the exiftool command on one of your IMG file and share the result?

@KrDw9ec4
Copy link
Author

Its a google Pixel... all UTC, in USA as well... surely the same in China. So we have a problem...它是谷歌 Pixel...都是 UTC,在美国也是如此...在中国当然也一样。 所以我们有一个问题...

Could you run the exiftool command on one of your IMG file and share the result?您能否在您的 IMG 文件之一上运行 exiftool 命令并分享结果?

ExifTool Version Number         : 12.57
File Name                       : IMG_20240703_151555.jpg
Directory                       : .
File Size                       : 4.7 MB
File Modification Date/Time     : 2024:07:03 15:15:57+08:00
File Access Date/Time           : 2024:07:21 01:01:40+08:00
File Inode Change Date/Time     : 2024:07:21 01:01:00+08:00
File Permissions                : -rwxr-xr-x
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Resolution Unit                 : inches
Make                            : Xiaomi
Camera Model Name               : 22021211RC
Orientation                     : Horizontal (normal)
Modify Date                     : 2024:07:03 15:15:55
Y Cb Cr Positioning             : Centered
ISO                             : 50
Exposure Program                : Program AE
F Number                        : 1.8
Exposure Time                   : 1/1079
Sensing Method                  : Not defined
Sub Sec Time Digitized          : 883
Sub Sec Time Original           : 883
Sub Sec Time                    : 883
Focal Length                    : 4.7 mm
Flash                           : Off, Did not fire
Light Source                    : D65
Metering Mode                   : Center-weighted average
Scene Capture Type              : Standard
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Focal Length In 35mm Format     : 25 mm
Max Aperture Value              : 1.8
Create Date                     : 2024:07:03 15:15:55
Exposure Compensation           : 0
Exif Image Height               : 3000
White Balance                   : Auto
Date/Time Original              : 2024:07:03 15:15:55
Brightness Value                : 7.44
Exif Image Width                : 4000
Exposure Mode                   : Auto
Aperture Value                  : 1.8
Components Configuration        : Y, Cb, Cr, -
Color Space                     : sRGB
Scene Type                      : Directly photographed
Shutter Speed Value             : 1/1078
Exif Version                    : 0220
Flashpix Version                : 0100
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
GPS Time Stamp                  : 07:15:53
GPS Processing Method           : CELLID
GPS Date Stamp                  : 2024:07:03
X Resolution                    : 72
Y Resolution                    : 72
Thumbnail Offset                : 5932
Thumbnail Length                : 29467
Compression                     : JPEG (old-style)
Image Width                     : 4000
Image Height                    : 3000
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 1.8
Image Size                      : 4000x3000
Megapixels                      : 12.0
Scale Factor To 35 mm Equivalent: 5.3
Shutter Speed                   : 1/1079
Create Date                     : 2024:07:03 15:15:55.883
Date/Time Original              : 2024:07:03 15:15:55.883
Modify Date                     : 2024:07:03 15:15:55.883
Thumbnail Image                 : (Binary data 29467 bytes, use -b option to extract)
GPS Altitude                    : 0 m Above Sea Level
GPS Date/Time                   : 2024:07:03 07:15:53Z
GPS Latitude                    : 30 deg 45' 6.41" N
GPS Longitude                   : 103 deg 55' 24.00" E
Circle Of Confusion             : 0.006 mm
Field Of View                   : 71.5 deg
Focal Length                    : 4.7 mm (35 mm equivalent: 25.0 mm)
GPS Position                    : 30 deg 45' 6.41" N, 103 deg 55' 24.00" E
Hyperfocal Distance             : 2.19 m
Light Value                     : 12.8

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

Thanks. The time zone in the exif aren't precised for the relevant fields:

Create Date                     : 2024:07:03 15:15:55
Create Date                     : 2024:07:03 15:15:55.883
Date/Time Original              : 2024:07:03 15:15:55.883

So this isn't easy

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

But the GPS date could help

GPS Date/Time                   : 2024:07:03 07:15:53Z

@KrDw9ec4
Copy link
Author

But the GPS date could help

GPS Date/Time                   : 2024:07:03 07:15:53Z

but there still many photos not have GPS info😢

Can't we simply configure the time zone of the date is captured from the Photo's file name?

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

I'm wondering how immich does in that case. What date is used when you drop one of your files on the application page?

I'm thinking to the following:

  • For google takeout, the date comes from the google metadata
  • Otherwise, an option to set the TZ of files

@KrDw9ec4
Copy link
Author

What date is used when you drop one of your files on the application page?

I'm not sure if I understand what you mean.

But if I upload it through immich Android, it is correct

image

@simulot
Copy link
Owner

simulot commented Jul 21, 2024

I mean, take on file from your directory and import it directly in the immich web page, and check its time

@KrDw9ec4
Copy link
Author

I mean, take on file from your directory and import it directly in the immich web page, and check its time我的意思是,从您的目录中获取文件并将其直接导入到 immich 网页中,然后检查其时间

same with Android APP, correct.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants