module: photos.utils

photos.utils.get_exif(path)

Return a string containing the EXIF data from a JPEG using the jhead utility

photos.utils.get_fov(exif)

Return the FOV (of the wider dimension) of a photo in degrees

photos.utils.hash_pil_image(pil)

Compute the md5 hash of a PIL image

photos.utils.numpy_to_pil(img)

Convert a floating point numpy array (0.0 to 1.0) to an 8bit PIL image (0 to 255)

photos.utils.pil_srgb_to_rgb(pil)

Convert a PIL image from sRGB to RGB

photos.utils.pil_to_numpy(pil)

Convert an 8bit PIL image (0 to 255) to a floating-point numpy array (0.0 to 1.0)

photos.utils.rgb_to_srgb(rgb)

Convert an image from linear RGB to sRGB.

Parameters:rgb – numpy array in range (0.0 to 1.0)
photos.utils.srgb_to_rgb(srgb)

Convert an image from sRGB to linear RGB.

Parameters:srgb – numpy array in range (0.0 to 1.0)