Jpeg Tag/Keyword support?

Help
2007-08-12
2013-05-30
  • bluegecko73
    bluegecko73
    2007-08-12

    Is there currently any library support available to MediaTomb that allows it to extract the Tag or Keyword details from a Jpeg file on Import so I can create a Keyword structure under Photos?
    I've looked at libexif and libextractor, but I've not been successful as yet in getting them to find and extract the right data from the jpeg files.

    If I try the 'exif', or 'extract' programs on the photos separately, they're not showing the extended metadata which is where I think the keywords are stored (using F-Spot, thats where they're listed, under the Subjects and Keywords label), which means I'm just guessing as to what values to specify in config.xml for libextractor's add-data element (although 'extract -L' does list some potentials). It would also suggest that this information will not be available to MediaTomb using either of those two libraries anyway.

    Also is there any logging that can be used or enabled thats accessible from the import.js file? It would be handy to be able to dump out the contents of the obj.meta or obj.aux to a log file so I could see what values were available.

     
    • Jin
      Jin
      2007-08-12

      libexif and libextractor are the only libs I can suggest, I do not know much about jpeg keywords, so far I have been only working with EXIF data - probably because I usually work with photos from my digicam and all digicams add some sort of exif info to the images.

      I do not know if you can really dump obj.meta or obj.aux, so you are right - that indeed would be handy; obj.meta is clearly defined, so you could look up the tags, for obj.aux you have to know what you put into the object (that's the stuff you specify in config.xml in the aux section)

      the AUX tags themselves - i.e. the ones that you can use are defined by the appropriate libraries.

      but... if exif/extract do not show anything on your photos - then the fields will be empty; those command line utilities use the same libraries as we do.

      the only thing I can suggest - find a program that would read your jpeg keywords and add EXIF tags. of course, if you know a library for reading jpeg keywords - tell me, I might have a look and maybe add support for that.

      below is a list of auxtags that we support for libexif (this is information is also available through libexif documentation)
      EXIF_TAG_INTEROPERABILITY_INDEX
      EXIF_TAG_INTEROPERABILITY_VERSION
      EXIF_TAG_IMAGE_WIDTH
      EXIF_TAG_IMAGE_LENGTH
      EXIF_TAG_BITS_PER_SAMPLE
      EXIF_TAG_COMPRESSION
      EXIF_TAG_PHOTOMETRIC_INTERPRETATION
      EXIF_TAG_FILL_ORDER
      EXIF_TAG_DOCUMENT_NAME
      EXIF_TAG_IMAGE_DESCRIPTION
      EXIF_TAG_MAKE
      EXIF_TAG_MODEL
      EXIF_TAG_STRIP_OFFSETS
      EXIF_TAG_ORIENTATION
      EXIF_TAG_SAMPLES_PER_PIXEL
      EXIF_TAG_ROWS_PER_STRIP
      EXIF_TAG_STRIP_BYTE_COUNTS
      EXIF_TAG_X_RESOLUTION
      EXIF_TAG_Y_RESOLUTION
      EXIF_TAG_PLANAR_CONFIGURATION
      EXIF_TAG_RESOLUTION_UNIT
      EXIF_TAG_TRANSFER_FUNCTION
      EXIF_TAG_SOFTWARE
      EXIF_TAG_DATE_TIME
      EXIF_TAG_ARTIST
      EXIF_TAG_WHITE_POINT
      EXIF_TAG_PRIMARY_CHROMATICITIES
      EXIF_TAG_TRANSFER_RANGE
      EXIF_TAG_JPEG_PROC
      EXIF_TAG_JPEG_INTERCHANGE_FORMAT
      EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH
      EXIF_TAG_YCBCR_COEFFICIENTS
      EXIF_TAG_YCBCR_SUB_SAMPLING
      EXIF_TAG_YCBCR_POSITIONING
      EXIF_TAG_REFERENCE_BLACK_WHITE
      EXIF_TAG_RELATED_IMAGE_FILE_FORMAT
      EXIF_TAG_RELATED_IMAGE_WIDTH
      EXIF_TAG_RELATED_IMAGE_LENGTH
      EXIF_TAG_CFA_REPEAT_PATTERN_DIM
      EXIF_TAG_CFA_PATTERN
      EXIF_TAG_BATTERY_LEVEL
      EXIF_TAG_COPYRIGHT
      EXIF_TAG_EXPOSURE_TIME
      EXIF_TAG_FNUMBER
      EXIF_TAG_IPTC_NAA
      EXIF_TAG_EXIF_IFD_POINTER
      EXIF_TAG_INTER_COLOR_PROFILE
      EXIF_TAG_EXPOSURE_PROGRAM
      EXIF_TAG_SPECTRAL_SENSITIVITY
      EXIF_TAG_GPS_INFO_IFD_POINTER
      EXIF_TAG_ISO_SPEED_RATINGS
      EXIF_TAG_OECF
      EXIF_TAG_EXIF_VERSION
      EXIF_TAG_DATE_TIME_ORIGINAL
      EXIF_TAG_DATE_TIME_DIGITIZED
      EXIF_TAG_COMPONENTS_CONFIGURATION
      EXIF_TAG_COMPRESSED_BITS_PER_PIXEL
      EXIF_TAG_SHUTTER_SPEED_VALUE
      EXIF_TAG_APERTURE_VALUE
      EXIF_TAG_BRIGHTNESS_VALUE
      EXIF_TAG_EXPOSURE_BIAS_VALUE
      EXIF_TAG_MAX_APERTURE_VALUE
      EXIF_TAG_SUBJECT_DISTANCE
      EXIF_TAG_METERING_MODE
      EXIF_TAG_LIGHT_SOURCE
      EXIF_TAG_FLASH
      EXIF_TAG_FOCAL_LENGTH
      EXIF_TAG_SUBJECT_AREA
      EXIF_TAG_MAKER_NOTE
      EXIF_TAG_USER_COMMENT
      EXIF_TAG_SUB_SEC_TIME_ORIGINAL
      EXIF_TAG_SUB_SEC_TIME_DIGITIZED
      EXIF_TAG_FLASH_PIX_VERSION
      EXIF_TAG_COLOR_SPACE
      EXIF_TAG_PIXEL_X_DIMENSION
      EXIF_TAG_PIXEL_Y_DIMENSION
      EXIF_TAG_RELATED_SOUND_FILE
      EXIF_TAG_INTEROPERABILITY_IFD_POINTER
      EXIF_TAG_FLASH_ENERGY
      EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE
      EXIF_TAG_FOCAL_PLANE_X_RESOLUTION
      EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION
      EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT
      EXIF_TAG_SUBJECT_LOCATION
      EXIF_TAG_EXPOSURE_INDEX
      EXIF_TAG_SENSING_METHOD
      EXIF_TAG_FILE_SOURCE
      EXIF_TAG_SCENE_TYPE
      EXIF_TAG_NEW_CFA_PATTERN
      EXIF_TAG_CUSTOM_RENDERED
      EXIF_TAG_CUSTOM_RENDERED
      EXIF_TAG_CUSTOM_RENDERED
      EXIF_TAG_CUSTOM_RENDERED
      EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM
      EXIF_TAG_SCENE_CAPTURE_TYPE
      EXIF_TAG_GAIN_CONTROL
      EXIF_TAG_CONTRAST
      EXIF_TAG_SATURATION
      EXIF_TAG_SHARPNESS
      EXIF_TAG_DEVICE_SETTING_DESCRIPTION
      EXIF_TAG_DEVICE_SETTING_DESCRIPTION
      EXIF_TAG_IMAGE_UNIQUE_ID

      and here is the list for libextractor:
      EXTRACTOR_UNKNOWN
      EXTRACTOR_FILENAME
      EXTRACTOR_MIMETYPE
      EXTRACTOR_TITLE
      EXTRACTOR_AUTHOR
      EXTRACTOR_ARTIST
      EXTRACTOR_DESCRIPTION
      EXTRACTOR_COMMENT
      EXTRACTOR_DATE
      EXTRACTOR_PUBLISHER
      EXTRACTOR_LANGUAGE
      EXTRACTOR_ALBUM
      EXTRACTOR_GENRE
      EXTRACTOR_LOCATION
      EXTRACTOR_VERSIONNUMBER
      EXTRACTOR_ORGANIZATION
      EXTRACTOR_COPYRIGHT
      EXTRACTOR_SUBJECT
      EXTRACTOR_KEYWORDS
      EXTRACTOR_CONTRIBUTOR
      EXTRACTOR_RESOURCE_TYPE
      EXTRACTOR_FORMAT
      EXTRACTOR_RESOURCE_IDENTIFIER
      EXTRACTOR_SOURCE
      EXTRACTOR_RELATION
      EXTRACTOR_COVERAGE
      EXTRACTOR_SOFTWARE
      EXTRACTOR_DISCLAIMER
      EXTRACTOR_WARNING
      EXTRACTOR_TRANSLATED
      EXTRACTOR_CREATION_DATE
      EXTRACTOR_MODIFICATION_DATE
      EXTRACTOR_CREATOR
      EXTRACTOR_PRODUCER
      EXTRACTOR_PAGE_COUNT
      EXTRACTOR_PAGE_ORIENTATION
      EXTRACTOR_PAPER_SIZE
      EXTRACTOR_USED_FONTS
      EXTRACTOR_PAGE_ORDER
      EXTRACTOR_CREATED_FOR
      EXTRACTOR_MAGNIFICATION
      EXTRACTOR_RELEASE
      EXTRACTOR_GROUP
      EXTRACTOR_SIZE
      EXTRACTOR_SUMMARY
      EXTRACTOR_PACKAGER
      EXTRACTOR_VENDOR
      EXTRACTOR_LICENSE
      EXTRACTOR_DISTRIBUTION
      EXTRACTOR_BUILDHOST
      EXTRACTOR_OS
      EXTRACTOR_DEPENDENCY
      EXTRACTOR_HASH_MD4
      EXTRACTOR_HASH_MD5
      EXTRACTOR_HASH_SHA0
      EXTRACTOR_HASH_SHA1
      EXTRACTOR_HASH_RMD160
      EXTRACTOR_RESOLUTION
      EXTRACTOR_CATEGORY
      EXTRACTOR_BOOKTITLE
      EXTRACTOR_PRIORITY
      EXTRACTOR_CONFLICTS
      EXTRACTOR_REPLACES
      EXTRACTOR_PROVIDES
      EXTRACTOR_CONDUCTOR
      EXTRACTOR_INTERPRET
      EXTRACTOR_OWNER
      EXTRACTOR_LYRICS
      EXTRACTOR_MEDIA_TYPE
      EXTRACTOR_CONTACT
      EXTRACTOR_THUMBNAIL_DATA

      the ones below only available in libextractor > 0.5.2
      EXTRACTOR_PUBLICATION_DATE
      EXTRACTOR_CAMERA_MAKE
      EXTRACTOR_CAMERA_MODEL
      EXTRACTOR_EXPOSURE
      EXTRACTOR_APERTURE
      EXTRACTOR_EXPOSURE_BIAS
      EXTRACTOR_FLASH
      EXTRACTOR_FLASH_BIAS
      EXTRACTOR_FOCAL_LENGTH
      EXTRACTOR_FOCAL_LENGTH_35MM
      EXTRACTOR_ISO_SPEED
      EXTRACTOR_EXPOSURE_MODE
      EXTRACTOR_METERING_MODE
      EXTRACTOR_MACRO_MODE
      EXTRACTOR_IMAGE_QUALITY
      EXTRACTOR_WHITE_BALANCE
      EXTRACTOR_ORIENTATION

       
    • bluegecko73
      bluegecko73
      2007-08-12

      From what I can see, the keywords I've got in my photos are in the newer Extensible Metadata Platform (XMP) format ("Adobe's XML-based specification for metadata geared toward digital images and multimedia").

      I had used Vistas Photo Gallery to Tag all my photos, so they're all categorized, which is really useful apart from the fact that nothing, including the Windows Media Players Network Sharing, can actually see the tags/keywords which is no use at all.
      I ideally want to replace XP on my Media Server box with Linux but retain the functionality I had before, which is the ability to view my photos through my PS3.
      After discovering MediaTomb this morning, it all seemed possible. I've already tweaked the import.js to allow me to browse by Year/Month/Day so I've got the same functionality as I had through XP. I just need to get the browse by Tags working next to make it even better.

      If you are interested in trying to incorporate the extra functionality, Adobe do have a downloadable XML SDK toolkit under the BSD license and the only library/program I've come across today that uses it to access XMP metadata is exempi (http://libopenraw.freedesktop.org/wiki/Exempi).
      I managed to get it built and installed (I think it just installs the library libexempi), and using the dumpmainxmp test program, I could see my tags.

       
    • Jin
      Jin
      2007-08-12

      looks interesting, there's even a package for Fedora so I guess the library is stable/good enough since it made it into the distro. Could you please send me one photo that is tagged accordingly, I need something for testing :> please send it to: jin at mediatomb dot cc

      also, is it possible that an image has both, XML and EXIF data? I guess I should figure out what to do in that case, or who gets more priority since double extraction would not really make sense.

      I'll look at the API of the library, our interface to adding new metadata extractors is very simple, so if the library is easy to use I could quickly add support for it.

       
    • bluegecko73
      bluegecko73
      2007-08-12

      A sample should be on its way to you. It'll have EXIF data and the XMP data.
      My camera puts the EXIF data in and the Vista Photo Gallery app puts the XMP data in (although there must be other apps, like Adobe Photoshop that do this too), although I don't know if it also duplicates the already present EXIF data when it saves the XMP metadata.

       
  • Petr Cerny
    Petr Cerny
    2011-10-08

    Hello, Sorry for opening that topic after such a long time, but how does it go with XMP support in MediaTomb?
    Peter