You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example of basic EXIF info taken from a JPEG:
The data we are interested in is:
title
caption
artist (equivalent to Dispatch author)
keywords (equivalent to Dispatch tags)
The Image model already has fields for title and authors, but you'll have to add fields for caption and tags.
When parsing the artist EXIF field, you should perform a lookup to see if a person with that name exists in the database:
# Gets or creates the person if they don't already existname=parse_name_from_EXIF()
person, created=Person.objects.get_or_create(full_name=name)
# You can now create a new Author instance:author=Author.objects.create(person=person, type="photographer")
# Add the author to the Image instanceself.authors.add(author)
Note: you'll want to do the same thing for the tags field.
The text was updated successfully, but these errors were encountered:
We want to automatically parse EXIF data from image files when they are uploaded to Dispatch.
Python EXIF package: https://pypi.python.org/pypi/ExifRead
The code that currently processes uploaded images is here: https://github.com/ubyssey/dispatch/blob/develop/dispatch/modules/content/models.py#L393-L413
Here's an example of basic EXIF info taken from a JPEG:
The data we are interested in is:
author
)tags
)The
Image
model already has fields fortitle
andauthors
, but you'll have to add fields forcaption
andtags
.When parsing the artist EXIF field, you should perform a lookup to see if a person with that name exists in the database:
Note: you'll want to do the same thing for the
tags
field.The text was updated successfully, but these errors were encountered: