The mg.metadata.camera_info application

Requires The mg.core.element application.

Django models

mg.metadata.camera_info Application models

This application permits to attach most used Camera data from Exif to Elements in the database, thus enabling classification of photos, and metadata inspection.

digraph camera_info {
element [shape = "box", label="Element\nmg.core.element"];
camera_info [shape = "box", label="CameraInfo"];
camera [shape = "box", label="Camera"];
lens [shape = "box", label="Lens"];

camera_info -> element [headlabel = "1", taillabel = "1"];
camera_info -> camera [headlabel = "1", taillabel = "*"];
camera_info -> lens [headlabel = "1", taillabel = "*"];
}

The Camera model

class mg.metadata.camera_info.models.Camera

This class contains all information about a given camera.

maker

Camera maker name.

model

Camera model name.

scale_to_35mm

Capter-specific factor to get 35mm focal lengths.

The Lens model

class mg.metadata.camera_info.models.Lens

This class contains all information about a given lens. For build-in lenses (like for compact cameras), the maker and model fields are copied from Camera, and built_in points to the Camera.

maker

Lens maker name.

model

Lens model name.

focal_length_min

Minimal focal lenth

focal_length_max

Maximal focal lenth. For non-zoom lenses, this field is equal to focal_length_min.

aperture_min

Minimal aperture. aperture = f/x with aperture_min = x

aperture_max

Maximal aperture. aperture = f/x with aperture_min = x. For fixed aperture lenses, this field is equal to aperture_min.

built_in

If non-null, this points to the camera where this lens is built-in.

The CameraInfo model

class mg.metadata.camera_info.models.CameraInfo
element

Pointer to a given Element.

camera

The Camera associated to the Element.

lens

The Lens associated to the Element, even if built-in.

owner

The camera owner name.

serial

The camera serial number.

Updaters

ExifCameraInfo

Updates the camera data associated to the element. Parses the Exif data from the original file, copy relevant fields to the database.

Templatetags

The mg_camera_info templatetag library

In order to use these templatetags, you must use the following code in your template:

{% load mg_camera_info %}

camera_info

This inclusion tag retrieves the HTML code to display camera information of element, if available.

{% camera_info element %}

It actually uses the template named camera_info/camera_info.html.