github.com/boki/go-xmp@v1.0.1/README.md (about)

     1  go-xmp
     2  ===========
     3  
     4  [![Build Status](https://travis-ci.org/trimmer-io/go-xmp.svg?branch=master)](https://travis-ci.org/trimmer-io/go-xmp)
     5  [![GoDoc](https://godoc.org/trimmer.io/go-xmp?status.svg)](https://godoc.org/trimmer.io/go-xmp/xmp)
     6  
     7  
     8  go-xmp is a native [Go](http://golang.org/) SDK for the [Extensible Metadata Platform](http://www.adobe.com/devnet/xmp.html) (XMP) as defined by the Adobe XMP Specification [Part 1](http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2016-08/XMPSpecificationPart1.pdf), [Part 2](http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2016-08/XMPSpecificationPart2.pdf) and [Part 3](http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2016-08/XMPSpecificationPart3.pdf), a.k.a ISO 16684-1:2011(E).
     9  
    10  Features
    11  --------
    12  
    13  ### Included metadata models
    14  
    15  * XMP DublinCore (dc)
    16  * XMP Media Management (xmpMM)
    17  * XMP Dynamic Media (xmpDM)
    18  * XMP Rights (xmpRights)
    19  * XMP Jobs (xmpBJ)
    20  * XMP Paged Text (xmpTPg)
    21  * EXIF v2.3.1 (exif, exifEX)
    22  * Adobe Camera Raw (crs)
    23  * Creative Commons (cc)
    24  * DJI Drones (dji)
    25  * ID3 v2.2, v2.3, v2.4 (id3)
    26  * iXML audio recorder (ixml)
    27  * iTunes/MP4 (itunes)
    28  * ISO/MP4 (mp4)
    29  * Quicktime (qt)
    30  * PhotoMechanic (pm)
    31  * Tiff (tiff)
    32  * Riff (riff)
    33  * Photoshop (ps)
    34  * PDF (pdf)
    35  
    36  ### Metadata models available under commercial license
    37  
    38  * ACES Image Metadata
    39  * AEScart
    40  * ARRI Camera Metadata
    41  * ASC CDL
    42  * EBU Broadcast WAV
    43  * Getty Images
    44  * IPTC Core 1.2, IPTC Extension 1.3, IPTC Video Metadata 1.0
    45  * Plus Licensing Metadata
    46  * SMPTE DPX Image Metadata
    47  * SMPTE MXF Metadata
    48  * OpenEXR Image Header Metadata
    49  * XMP Media Production SDK (Universal Metadata Container)
    50  
    51  
    52  Documentation
    53  -------------
    54  
    55  - [API Reference](http://godoc.org/trimmer.io/go-xmp/xmp)
    56  - [FAQ](https://github.com/trimmer-io/go-xmp/wiki/FAQ)
    57  
    58  Installation
    59  ------------
    60  
    61  Install go-xmp using the "go get" command:
    62  
    63      go get trimmer.io/go-xmp
    64  
    65  The Go distribution is go-xmp's only dependency.
    66  
    67  Examples
    68  --------
    69  
    70  
    71  
    72  
    73  Benchmarks
    74  ----------
    75  
    76  ```
    77  go test ./test/ -bench=. -benchmem
    78  
    79  goos: darwin
    80  goarch: amd64
    81  pkg: trimmer.io/go-xmp/test
    82  BenchmarkUnmarshalXMP_5kB-8       5000      321524 ns/op     58071 B/op     1056 allocs/op
    83  BenchmarkMarshalXMP_5kB-8         5000      270981 ns/op     61384 B/op      758 allocs/op
    84  BenchmarkMarshalJSON_5kB-8        5000      338354 ns/op     91855 B/op     1023 allocs/op
    85  BenchmarkUnmarshalJSON_5kB-8      5000      382196 ns/op     60387 B/op     1022 allocs/op
    86  BenchmarkUnmarshalXMP_85kB-8       300     5152080 ns/op    902794 B/op    17779 allocs/op
    87  BenchmarkMarshalXMP_85kB-8         300     4292143 ns/op    966356 B/op    12209 allocs/op
    88  BenchmarkMarshalJSON_85kB-8        300     5378268 ns/op   1453004 B/op    16535 allocs/op
    89  BenchmarkUnmarshalJSON_85kB-8      200     5512114 ns/op    880161 B/op    14497 allocs/op
    90  ```
    91  
    92  XMP Marshal Benchmark using `premiere-cc.xmp`, a rather large xmpDM file with history, xmpMM:Pantry etc.
    93  
    94  ```
    95    Compression Results 417        mean               min                  max
    96    -----------------------------------------------------------------------------
    97          Original sizes       4013 (100.0)        918 (100.0)      86940 (100.0)
    98               XMP sizes       3545 ( 90.4)        723 ( 52.3)      78325 (147.0)
    99          XMP Gzip sizes       1177 ( 32.0)        369 (  8.4)       8086 ( 61.3)
   100        XMP Snappy sizes       1195 ( 32.5)        387 (  8.4)       8104 ( 62.9)
   101              JSON sizes       2147 ( 52.8)        389 ( 31.6)      65127 ( 91.7)
   102         JSON Gzip sizes        889 ( 23.7)        209 (  6.9)       7714 ( 50.5)
   103       JSON Snappy sizes        907 ( 24.3)        227 (  7.0)       7732 ( 50.6)
   104    -----------------------------------------------------------------------------
   105          XML->XMP times          371.674µs           74.091µs         4.816883ms
   106         XMP->JSON times          234.785µs            36.91µs         4.517591ms
   107          XMP->XML times          259.084µs           20.004µs         4.505254ms
   108          XMP Gzip times          214.342µs          105.685µs         1.036886ms
   109        XMP Gunzip times           59.948µs           19.924µs          285.113µs
   110        XMP Snappy times           28.325µs            7.975µs          234.161µs
   111      XMP Unsnappy times           25.841µs            7.899µs          195.265µs
   112         JSON Gzip times          197.268µs            93.86µs          968.985µs
   113       JSON Gunzip times           53.622µs           17.655µs         2.913516ms
   114       JSON Snappy times           23.581µs            7.864µs          221.674µs
   115     JSON Unsnappy times           37.215µs            7.856µs          398.361µs
   116  ```
   117  
   118  Size matters when storing XMP in a database or sending documents over a network. Above is a quick comparison between common compression methods gzip and snappy regarding runtime and size for documents in the samples/ directory. What's also included is a comparison of the uncompressed documents in XMP/XML and XMP/JSON format. Original means the initial XMP document as stored in .xmp sidecar files. To be fair, some originals use padding, so the mean size distribution is larger than what go-xmp generated here because padding was turned off during write.
   119  
   120  Contributing
   121  ------------
   122  
   123  See [CONTRIBUTING.md](https://github.com/trimmer-io/go-xmp/blob/master/.github/CONTRIBUTING.md).
   124  
   125  
   126  License
   127  -------
   128  
   129  go-xmp is available under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
   130