LibrePhotos / librephotos

A self-hosted open source photo management service. This is the repository of the backend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Display more image metadata

craumix opened this issue · comments

From what I can make out, currently only geolocation and the timestamp are exported from the imported images. (Please feel free to close this if I'm wrong)

I think it would be important to import all of an images metadata, especially for RAW images.

This is related to #10

All the exif data is saved as a json here:

exif_json = JSONField(blank=True, null=True)

And set here:

librephotos/api/models.py

Lines 305 to 312 in 7f3d175

def _extract_date_time_from_exif(self):
date_format = "%Y:%m:%d %H:%M:%S"
timestamp_from_exif = None
with open(self.image_path, 'rb') as fimg:
exif = exifread.process_file(fimg, details=False)
serializable = dict(
[key, value.printable] for key, value in exif.items())
self.exif_json = serializable

And here:

librephotos/api/models.py

Lines 342 to 348 in 7f3d175

def _extract_gps_from_exif(self):
with open(self.image_path, 'rb') as fimg:
exif = exifread.process_file(fimg, details=False)
serializable = dict(
[key, value.printable] for key, value in exif.items())
self.exif_json = serializable
if 'GPS GPSLongitude' in exif.keys():

But yeah, we should import all the metadata as own fields and display it in the frontend. Do you have a list of what fields we should add?

I'm not sure if exporting all the metadata as own fields is necessary since it only needs to be displayed...
But if you want to go that route I would probably choose something similar to what Photoprism shows so:

  • Altitude
  • Camera
  • ISO
  • Exposure
  • Lens
  • F Number
  • Focal Length

I would recommend to also read the IPTC info like keywords, caption etc. See https://www.carlseibert.com/guide-iptc-photo-metadata-fields/ for a photographers idea about what to use

I've rewritten most of the EXIF read portion of the code to be more efficient and updated the module that reads the EXIF data to support any file format supported by exiftool (https://exiftool.org/#supported). Other code needs to be changed for those new files types to be imported, but when that happens we'll be able to read the EXIF data.

We're still working on an efficient way to store the information and display it but it's not trivial.

Great you are working on this, just want to second that request. Extended request would be to search for it :-)

+1, that would be awesome. If it is possible to implement after this is done, editing things like keywords or other metadata from the webif would be neat too

More exif data fields are now in the backend. It now just has to be implemented in the web view.

This is amazing.
Definitely looking forward to more exif data being visible. Would this also make it easier to search and show images based on similar EXIF data? For example, all photos taken with that camera?

Will there need to be a rescan of the photos to have this data viewed in the frontend?