Used to work with jpg images.
A lazy Image object to make working with JPG images a bit easier. Image data is only read when it is actually required.
The Image object is iterable, but yields Image.ContainedPerson instances
| Parameters: | image_path – A path to the image file |
|---|---|
| Raises : | InvalidConfig if the image_path does not exist |
A generic contained person inside an image
Note
Bounding box coordinates are in pixels relative to the absolute size of the image and where the top left corner is 0,0
| Parameters: | |
|---|---|
| Variables: | google_id – str The Google hash of the contact |
This is used to add extra linking information to a Image.ContainedPerson. The flickr module uses it to attach the flickr_id as well as the flickr_username.
Before adding your id, it’s probably a good idea to check has_id() first.
| Parameters: |
|
|---|---|
| Raises : | InvalidState if a non-unique ID is being used |
Return the value associated with an ID or None if that ID does not exist.
Note
A return value of None is not the same as checking the ID for existence. It is entirely possible to have an ID associated with None, which may have some special meaning.
| Parameters: | id – The key to lookup |
|---|---|
| Returns: | The object stored with the ID or None |
A Boolean property to determine if the Image.ContainedPerson has a bounding box.
Property for getting the height of the bounding box in pixels
Property for getting the width of the bounding box in pixels
Property for getting the top left x coord for the bounding box
Property for getting the top left y coord for the bounding box
| Parameters: |
|---|
The psuedo-fingerprint of the image
A datetime.datetime based on the DateTimeOriginal field of the exif data
Easy access to the EXIF data for an image
The normalized form of the filename for the image
The height of the image in pixels
Easy access to the IPTC data for an image
The absolute directory of the image
Get a shallow copy of the people contained in the photo that is safe for modification.
| Returns: | list of Image.ContainedPerson |
|---|---|
| Return type: | list |
The width of the image in pixels