Skip to content

pmapcat/CoExif

Repository files navigation

CoExif is a fast cacheable JSON REST File Metadata Server, which supports nearly any file format. It uses one of the best metadata management tools outhere: Exiftool. Internally, CoExif uses a pool of long running ExifTool processes.

Circle CI

#Getting Started

Installation

Exiftool. must be downloaded. One of these builds must be downloaded also:

Server must be started providing a path to Exiftool executable. Like this:

co_exif -root "/home/mik/" -port 9200 -auth-name="admin" -auth-pass="admin" -exif-path="./exif_tool/exiftool"

Now, the server can be queried. This part of url:

127.0.0.1:9200/<this_part><filters>

is FS path without -root param in server settings.

GET

curl -u admin:admin 127.0.0.1:9200/2.jpg
{
  "Items": [
    {
      "APP14Flags0": "[14]",
      "APP14Flags1": "(none)",
      "AlreadyApplied": true,
      "ApplicationRecordVersion": 0,
      "AutoLateralCA": 0,
      "BitsPerSample": 8,
      "Blacks2012": "+14",
      "BlueHue": 0,
      "BlueMatrixColumn": "0.14307 0.06061 0.7141",
      "BlueSaturation": 0,
      "BlueTRC": "(Binary data 2060 bytes, use -b option to extract)",
      "Brightness": "+50",
      "CMMFlags": "Not Embedded, Independent",
      "CameraProfile": "Adobe Standard",
      ......
      }
   ]
}

Filtered GET

It is good to have been able to select specific tags:

curl -u admin:admin "http://127.0.0.1:9999/home/mik/?tags=FileAccessDate&tags=FileName"
{
  "Items": [
    {
      "FileAccessDate": "2015:08:02 20:10:40+03:00",
      "FileName": "output.avi",
      "SourceFile": "/home/mik/output.avi"
    },
    {
      "FileAccessDate": "2015:11:02 15:24:44+03:00",
      "FileName": "DSC_0158.NEF",
      "SourceFile": "/home/mik/DSC_0158.NEF"
    },
  ]
}    

POST metadata

Post will replace metadata in a file with specified fields. Please refer to Exiftool TagNames to know what type of tags can be rewritten.

Example:

// POST DATA
curl -XPOST http://127.0.0.1:9999/a.png -u admin:admin -H "Content-Type: application/json" -d '{"Artist":"Mik-s picture","Author":"Blablablab"}'
// RESULTS
curl -u admin:admin "127.0.0.1:9999/a.png?tags=Artist&tags=Author"
{
  "Items": [
    {
      "Artist": "Mik-s picture",
      "Author": "Blablablab",
      "SourceFile": "/home/mik/a.png"
    }
  ]
}

SERVER PARAMS

  -auth-name="admin": Enter auth name
  -auth-pass="admin": Enter auth pass
  -auto-spawn=false: Should I autospawn processes
  -exif-path="./exif_tool/exiftool": Enter path to exiftool
  -max-prox=10: Enter number of ExifTool processes
  -port="9999": Enter a server port number
  -root="/": Enter default root path

About

CoExif is a fast JSON REST File Metadata Server

Resources

License

Stars

Watchers

Forks

Packages

No packages published