Giter Club home page Giter Club logo

expose's Introduction

expose

Expose provides a Go package and command tool for extracting and parsing XMP, EXIF and IPTC metadata from image and video files using the exiv2 binary tool. The output data is grouped by type in JSON format.

This example was created for the Feb 2017 GoLangPhilly meetup presentation on Processing Image and Video Metadata by Rob Murtha.

Exiv2 Dependency

This package requires the exiv2 binary (see instructions below). exiv2 website exiv2 download / source

Install go package and tools

go get github.com/robmurtha/expose

Run

Usage: expose [-flags] filename
flags:
  -p    pretty JSON
  -v    verbose logging

Organization

This project includes a main.go for running from the command line and extracting all possible information. An exiv2 parsing package is included and can be used independently.

    // parse XMP tags
    // with output from exiv2 -PXgnycv filename (see main)
	expose := exiv2.New(output)
	fields, _ := expose.Fields()
	jsonBytes, _ := json.Marshal(fields)
	

Installing

mac-os (brew)

brew install exiv2

Compiling on mac with brew

The default brew version has video support disabled, if you need video support follow these instructions.

wget http://exiv2.org/exiv2-0.25.tar.gz
tar -xzf exiv2-0.25.tar.gz
cd exiv2-0.25
brew install exiv2 --only-dependencies
./configure --enable-video
make install

apt-get

apt-get install exiv2

Sample JSON

The JSON records are organized by metadata type as arrays of Field. Organization by group, type and additional parsing of values is up to the user.

{
 "expose": {
  "xmp": [
   {
    "group": "video",
    "name": "FileSize",
    "type": "XmpText",
    "count": 9,
    "value": "0.0515432"
   },
   {
    "group": "video",
    "name": "FileName",
    "type": "XmpText",
    "count": 27,
    "value": "testdata/samsung_galaxy.mp4"
   },
   {
    "group": "video",
    "name": "MimeType",
    "type": "XmpText",
    "count": 15,
    "value": "video/quicktime"
...

expose's People

Contributors

robmurtha avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.