colour_hdri.utilities.exif Module

EXIF Manipulation

Exif data manipulation routines based on exiftool:

class colour_hdri.utilities.exif.ExifTag[source]

Bases: colour_hdri.utilities.exif.ExifTag

Hunt colour appearance model induction factors.

Parameters:
  • group (unicode, optional) – Exif tag group name.
  • name (unicode, optional) – Exif tag name.
  • value (object, optional) – Exif tag value.
  • identifier (numeric, optional) – Exif tag identifier.

Returns a new instance of the ExifTag class.

colour_hdri.utilities.exif.parse_exif_string(exif_tag)[source]

Parses given exif tag assuming it is a string and return its value.

Parameters:exif_tag (ExifTag) – Exif tag to parse.
Returns:Parsed exif tag value.
Return type:unicode
colour_hdri.utilities.exif.parse_exif_numeric(exif_tag, dtype=<class 'numpy.float64'>)[source]

Parses given exif tag assuming it is a numeric type and return its value.

Parameters:
  • exif_tag (ExifTag) – Exif tag to parse.
  • dtype (object, optional) – Return value data type.
Returns:

Parsed exif tag value.

Return type:

numeric

colour_hdri.utilities.exif.parse_exif_fraction(exif_tag, dtype=<class 'numpy.float64'>)[source]

Parses given exif tag assuming it is a fraction and return its value.

Parameters:
  • exif_tag (ExifTag) – Exif tag to parse.
  • dtype (object, optional) – Return value data type.
Returns:

Parsed exif tag value.

Return type:

numeric

colour_hdri.utilities.exif.parse_exif_array(exif_tag, dtype=<class 'numpy.float64'>, shape=None)[source]

Parses given exif tag assuming it is an array and return its value.

Parameters:
  • exif_tag (ExifTag) – Exif tag to parse.
  • dtype (object, optional) – Return value data type.
  • shape (array_like, optional) – Shape of
Returns:

Parsed exif tag value.

Return type:

ndarray

colour_hdri.utilities.exif.parse_exif_data(data)[source]

Parses given exif data output from exiftool.

Parameters:data (unicode) – Exif data.
Returns:Parsed exif data.
Return type:list
colour_hdri.utilities.exif.read_exif_tags(image)[source]

Returns given image exif image tags.

Parameters:image (unicode) – Image file.
Returns:Exif tags.
Return type:defaultdict
colour_hdri.utilities.exif.copy_exif_tags(source, target)[source]

Copies given source image file exif tag to given image target.

Parameters:
  • source (unicode) – Source image file.
  • target (unicode) – Target image file.
Returns:

Definition success.

Return type:

bool

colour_hdri.utilities.exif.update_exif_tags(images)[source]

Updates given images siblings images pairs exif tags.

Parameters:images (list) – Image files to update.
Returns:Definition success.
Return type:bool
colour_hdri.utilities.exif.delete_exif_tags(image)[source]

Deletes all given image exif tags.

Parameters:image (unicode) – Image file.
Returns:Definition success.
Return type:bool
colour_hdri.utilities.exif.read_exif_tag(image, tag)[source]

Returns given image exif tag value.

Parameters:
  • image (unicode) – Image file.
  • tag (unicode) – Tag.
Returns:

Tag value.

Return type:

unicode

colour_hdri.utilities.exif.write_exif_tag(image, tag, value)[source]

Sets given image exif tag value.

Parameters:
  • image (unicode) – Image file.
  • tag (unicode) – Tag.
  • value (unicode) – Value.
Returns:

Definition success.

Return type:

bool