File: metadata.rst

package info (click to toggle)
thumbor 7.7.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,556 kB
  • sloc: xml: 295,435; python: 18,673; ansic: 1,479; makefile: 360; sh: 27
file content (74 lines) | stat: -rw-r--r-- 1,821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Image Metadata
==============

Thumbor uses `piexif <https://github.com/hMatoba/Piexif>`_ to read and write image metadata.

The image metadata is available in ``engine.metadata``.



Reading and writing Metadata
----------------------------

Let's retrieve a list of all the available EXIF tags available in the image::

  >>> engine.metadata
  {
    '0th': {
        271: b'Canon',
        272: b'Canon EOS 5D Mark III',
        282: (300, 1),
        283: (300, 1),
        296: 2,
        305: b'Adobe Photoshop Lightroom 4.4 (Macintosh)',
        306: b'2016:06:24 14:45:44',
        34665: 216
    },
    'Exif': {
        33434: (1, 100),
        33437: (56, 10),
        34850: 1,
        34855: 640,
        34864: 2,
        34866: 640,
        36864: b'0230',
        36867: b'2016:06:23 13:18:05',
        36868: b'2016:06:23 13:18:05',
        37377: (6643856, 1000000),
        37378: (4970854, 1000000),
        37380: (0, 1),
        37381: (3, 1),
        37383: 5,
        37385: 16,
        37386: (123, 1),
        37521: b'91',
        37522: b'91',
        41486: (5242880, 32768),
        41487: (5242880, 32768),
        41488: 4,
        41985: 0,
        41986: 1,
        41987: 1,
        41990: 0,
        42033: b'042024004240',
        42034: ((70, 1), (200, 1), (0, 0), (0, 0)),
        42036: b'EF70-200mm f/2.8L IS II USM',
        42037: b'0000c139be'},
    'GPS': {},
    'Interop': {},
    '1st': {},
    'thumbnail': None
  }

The reference to the values can be found here `Exif values <https://github.com/hMatoba/Piexif/blob/master/piexif/_exif.py>`

  >>> tag = metadata["Exif"][piexif.ExifIFD.DateTimeOriginal]
  "2016:06:23 13:18:05"


piexif API reference
------------------------------

.. module:: piexif
.. autoclass:: dict
   :members: __getitem__, __setitem__, __delitem__