4

I'm trying to extract the details of a file using Python. Specifically, when I right click a photo and select properties, under the Details tab of the menu that pops up, there's a whole bunch of details about the file. What I really need is the contents of the "People" detail.

This is the menu in question:

Is there a good way of getting that People detail in a string or something?

Some people have suggested using ExifRead. I tried that, but it didn't pull the People tag out of the Exif data.

Kara
  • 6,115
  • 16
  • 50
  • 57
Beegrene
  • 41
  • 1
  • 4
  • 1
    That page is just reading the EXIF metadata out of the file. So you either need to write something that reads the jpg and parses the EXIF metadata or use a library that does it. – Jerry Jeremiah Aug 18 '16 at 05:28
  • Perhaps something like https://www.google.co.nz/?gfe_rd=cr&ei=iUe1V4GXF6nM8gfoi7mIBQ&gws_rd=ssl#q=python+jpeg+exif+metadata – Jerry Jeremiah Aug 18 '16 at 05:29
  • 2
    Possible duplicate of [In Python, how do I read the exif data for an image?](http://stackoverflow.com/questions/4764932/in-python-how-do-i-read-the-exif-data-for-an-image) – Vasili Syrakis Aug 18 '16 at 06:21
  • check this out: https://pypi.python.org/pypi/ExifRead – Bedi Egilmez Aug 18 '16 at 07:20

1 Answers1

1

This is not EXIF data but rather data that Windows populates for different types of objects in the Windows Property System.

The one you are concerned with is called System.Photo.PeopleNames:

propertyDescription
   name = System.Photo.PeopleNames
   shellPKey = PKEY_Photo_PeopleNames
   formatID = E8309B6E-084C-49B4-B1FC-90A80331B638
   propID = 100
   searchInfo
      inInvertedIndex = true
      isColumn = true
      isColumnSparse = true
      columnIndexType = OnDemand
      maxSize = 128
      mnemonics = people|people tag|people tags
   labelInfo
      label = People
      sortDescription
      invitationText = Add a people tag
      hideLabel = false
   typeInfo
      type = String
      groupingRange = Discrete
      isInnate = true
      canBePurged = true
      multipleValues = true
      isGroup = false
      aggregationType = Union
      isTreeProperty = false
      isViewable = true
      isQueryable (Vista) = false
      includeInFullTextQuery (Vista) = false
      searchRawValue (Windows 7) = true
      conditionType = String
      defaultOperation = Equal
   aliasInfo
      sortByAlias = None
      additionalSortByAliases = None
   displayInfo
      defaultColumnWidth = 11
      displayType = String
      alignment = Left
      relativeDescriptionType = General
      defaultSortDirection = Ascending
      stringFormat
         formatAs = General
      booleanFormat
         formatAs = YesNo
      numberFormat
         formatAs = General
         formatDurationAs = hh:mm:ss
      dateTimeFormat
         formatAs = General
         formatTimeAs = ShortTime
         formatDateAs = ShortDate
      enumeratedList
         defaultText
         useValueForDefault = False
         enum
            value
            text
         enumRange
            minValue
            setValue
            text
      drawControl
         control = Default
      editControl
         control = Default
      filterControl
         control = Default
      queryControl
         control = Default

To access this information in Python, use win32com.propsys.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • This didn't work at first, but I added the line `PKEY_Photo_PeopleNames = (IID('{E8309B6E-084C-49B4-B1FC-90A80331B638}'), 100)` to my pscon.py file and it worked. Thanks for pointing me in the right direction. – Beegrene Aug 21 '16 at 22:20