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

When uploading images, respect the capture date in EXIF date #2296

Open
thibaultmol opened this issue Dec 1, 2024 · 3 comments
Open

When uploading images, respect the capture date in EXIF date #2296

thibaultmol opened this issue Dec 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@thibaultmol
Copy link
Collaborator

It seems like the current mechanism for extracting the date from the file doesn't check all possible fields

https://drive.proton.me/urls/3DSNNKHA90#00ycZP0aK9Z1

image

For example this image taken on Luna's phone has two exif fields that are currently not checked by the mapcomplete code i think.
Resulting that this image gets uploaded with the current date fallback instead:
https://dev.mapcomplete.org/rainbow_crossings.html?z=19&lat=50.899434499999074&lon=4.837160800005449&background=carto.dark_matter#node/4492992077

@thibaultmol thibaultmol added the bug Something isn't working label Dec 1, 2024
@pietervdvn
Copy link
Owner

I've added a small check for those fields, but I didn't check at all if this code works. Please test it on dev.

@thibaultmol
Copy link
Collaborator Author

Seems to be fixed now, waiting for Luna to upload one of her images on her end to see how that goes. will close when that's also confirmed to be working

@thibaultmol
Copy link
Collaborator Author

Seems like my images are fine but luna's arent somehow.

the image luna uploaded here:
https://dev.mapcomplete.org/benches.html?z=19&lat=51.205002900000125&lon=3.4480064999993374&background=carto.dark_matter&layer-picnic_table=false&layer-bench_at_pt=false#node/12390322617

https://api.panoramax.xyz/#focus=meta&map=17/51.205003/3.448007&pic=fe3f28b4-f7b5-49d1-9b3d-d20853e1b301&speed=250&xyz=126.00/0.00/30

has the wrong date.

the actual file's exif data shows:

FileName                        : 20241130_110642.jpg
Directory                       : .
FileSize                        : 4.2 MB
FileModifyDate                  : 2024:12:04 11:48:54+01:00
FileAccessDate                  : 2024:12:04 11:48:54+01:00
FileInodeChangeDate             : 2024:12:04 11:48:54+01:00
FilePermissions                 : -rw-r--r--
FileType                        : JPEG
FileTypeExtension               : jpg
MIMEType                        : image/jpeg
ExifByteOrder                   : Big-endian (Motorola, MM)
Model                           : SM-A145R
Orientation                     : Horizontal (normal)
ModifyDate                      : 2024:11:30 11:06:42
FNumber                         : 1.8
ExposureTime                    : 1/167
FocalLength                     : 4.0 mm
Flash                           : No Flash
MeteringMode                    : Center-weighted average
ISO                             : 100
FocalLengthIn35mmFormat         : 26 mm
MaxApertureValue                : 2.6
CreateDate                      : 2024:11:30 11:06:42
ExposureCompensation            : 0
WhiteBalance                    : Auto
DateTimeOriginal                : 2024:11:30 11:06:42
ApertureValue                   : 1.9
Make                            : samsung
JFIFVersion                     : 1.01
ResolutionUnit                  : None
XResolution                     : 1
YResolution                     : 1
ImageWidth                      : 4080
ImageHeight                     : 3060
EncodingProcess                 : Baseline DCT, Huffman coding
BitsPerSample                   : 8
ColorComponents                 : 3
YCbCrSubSampling                : YCbCr4:2:0 (2 2)
Aperture                        : 1.8
ImageSize                       : 4080x3060
Megapixels                      : 12.5
ScaleFactor35efl                : 6.5
ShutterSpeed                    : 1/167
CircleOfConfusion               : 0.005 mm
FOV                             : 69.4 deg
FocalLength35efl                : 4.0 mm (35 mm equivalent: 26.0 mm)
HyperfocalDistance              : 1.91 m
LightValue                      : 9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants