xmpr 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/README.md +48 -0
- data/lib/xmpr.rb +2 -3
- data/lib/xmpr/version.rb +1 -1
- metadata +17 -19
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6f0ad440f14b09354720adb4213ff7d2f2d85f9fab7fcbfaf9cd78e478230548
|
4
|
+
data.tar.gz: f578707eca819fd8d9b7f8afcc07b2c70362c1be42905c7f05a97260c15b2f85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f6bad1fdd87cfe461ad210675c9c2d4f43c9db71d04a8b250fb4ba5389f5a6d767e124d65aa5c0f7c98c8b8f55189e7d38dbe21141f81e2d1ae4c8bbdca911e
|
7
|
+
data.tar.gz: 7fc9380ec366fb686fa7084a9ccdcf13e9b749e9d620fbe8e06790595627999ecf0ff1b3e7ee7f5385aa03f910723e5f35db8f2402867f4cc7d85a82d3e0199c
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
�e�
|
2
|
-
��Ew�ʼnuϏ��!i�"i�GK��~w̎HM%G"sC�:�N��|�zk� ވ�_�+3�Sm
|
1
|
+
��$֒a�ҊS�x�6�&}>d�.�����W���xa�] ��ek���ϱ�ˉюә��Q�q�q�nQ�m1������3Oؑ�f��wi���~C��p�ݛ¦�:�K���"�^���˳7���P"��|���Kq�<����K��u{�G��e9�q��BR����g�٩��7t�:���� '�Ri-tZ�8|�� O���Pƙ�S�Hx0QYr���s����͠��_t~� _����(�C�rin�G��
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -4,6 +4,47 @@
|
|
4
4
|
|
5
5
|
XMP Reader in Ruby. Parse XMP data extracted from an image into rich data types.
|
6
6
|
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Use something like imagemagick to extract the XMP, then read it with this class:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require "xmpr"
|
13
|
+
raw_xmp = `convert image.jpg xmp:-`
|
14
|
+
xmp = XMPR.parse(raw_xmp)
|
15
|
+
xmp["dc", "title"] # => "Amazing Photo"
|
16
|
+
xmp["photoshop", "Category"] # => "summer"
|
17
|
+
xmp["photoshop", "SupplementalCategories"] # => ["morning", "sea"]
|
18
|
+
```
|
19
|
+
|
20
|
+
The xmp instance fetches namespaced attributes. You can use fully qualified namespaces, or some namespaces have shortcuts:
|
21
|
+
|
22
|
+
```
|
23
|
+
xmp["http://purl.org/dc/elements/1.1/", "title"] # => "Amazing Photo"
|
24
|
+
xmp["dc", "title"] # => "Amazing Photo" (same thing)
|
25
|
+
```
|
26
|
+
|
27
|
+
The following namespaces have shortcuts:
|
28
|
+
|
29
|
+
* `aux` — `http://ns.adobe.com/exif/1.0/aux/`
|
30
|
+
* `cc` — `http://creativecommons.org/ns#` ([Creative Commons](http://creativecommons.org))
|
31
|
+
* `crs` — `http://ns.adobe.com/camera-raw-settings/1.0/`
|
32
|
+
* `dc` — `http://purl.org/dc/elements/1.1/` ([Dublin Core](http://dublincore.org/))
|
33
|
+
* `exif` — `http://ns.adobe.com/exif/1.0/`
|
34
|
+
* `Iptc4xmpCore` — `http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/` ([IPTC](http://iptc.org/))
|
35
|
+
* `pdf` — `http://ns.adobe.com/pdf/1.3/`
|
36
|
+
* `photoshop` — `http://ns.adobe.com/photoshop/1.0/`
|
37
|
+
* `rdf` — `http://www.w3.org/1999/02/22-rdf-syntax-ns#`
|
38
|
+
* `tiff` — `http://ns.adobe.com/tiff/1.0/`
|
39
|
+
* `x` — `adobe:ns:meta/`
|
40
|
+
* `xap` — `http://ns.adobe.com/xap/1.0/`
|
41
|
+
* `xmp` — `http://ns.adobe.com/xap/1.0/` ([XMP](http://www.adobe.com/products/xmp.html))
|
42
|
+
* `xmpidq` — `http://ns.adobe.com/xmp/Identifier/qual/1.0/`
|
43
|
+
* `xmpBJ` — `http://ns.adobe.com/xap/1.0/bj/`
|
44
|
+
* `xmpRights` — `http://ns.adobe.com/xap/1.0/rights/`
|
45
|
+
* `xmpMM` — `http://ns.adobe.com/xap/1.0/mm/`
|
46
|
+
* `xmpTPg` — `http://ns.adobe.com/xap/1.0/t/pg/`
|
47
|
+
|
7
48
|
## Thanks
|
8
49
|
|
9
50
|
Refactored from [XMP][xmp-gem]. Inspired by [ExifTool][exiftool].
|
@@ -11,6 +52,13 @@ Refactored from [XMP][xmp-gem]. Inspired by [ExifTool][exiftool].
|
|
11
52
|
[xmp-gem]: https://github.com/amberbit/xmp
|
12
53
|
[exiftool]: http://www.sno.phy.queensu.ca/~phil/exiftool/
|
13
54
|
|
55
|
+
## References
|
56
|
+
|
57
|
+
* XMP specification
|
58
|
+
([Part 1](http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart1.pdf),
|
59
|
+
[Part 2](http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf),
|
60
|
+
[Part 3](http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart3.pdf))
|
61
|
+
|
14
62
|
## License
|
15
63
|
|
16
64
|
MIT license, see [LICENSE](LICENSE).
|
data/lib/xmpr.rb
CHANGED
@@ -20,7 +20,8 @@ module XMPR
|
|
20
20
|
# Namespace shortcuts, and fallbacks for undeclared namespaces.
|
21
21
|
NAMESPACES = {
|
22
22
|
"aux" => "http://ns.adobe.com/exif/1.0/aux/",
|
23
|
-
"
|
23
|
+
"cc" => "http://creativecommons.org/ns#",
|
24
|
+
"crs" => "http://ns.adobe.com/camera-raw-settings/1.0/",
|
24
25
|
"dc" => "http://purl.org/dc/elements/1.1/",
|
25
26
|
"exif" => "http://ns.adobe.com/exif/1.0/",
|
26
27
|
"Iptc4xmpCore" => "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/",
|
@@ -100,8 +101,6 @@ module XMPR
|
|
100
101
|
alt_value(alt_element, lang: lang)
|
101
102
|
elsif array_element = element.xpath("./rdf:Bag | ./rdf:Seq", NAMESPACES).first
|
102
103
|
array_value(array_element)
|
103
|
-
else
|
104
|
-
raise "Don't know how to handle:\n#{element}"
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
data/lib/xmpr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Cochran
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDKDCCAhCgAwIBAgIBBzANBgkqhkiG9w0BAQsFADA6MQ0wCwYDVQQDDARzajI2
|
14
14
|
MRQwEgYKCZImiZPyLGQBGRYEc2oyNjETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0x
|
15
|
-
|
15
|
+
OTEwMjQwNjM0MjJaFw0yMDEwMjMwNjM0MjJaMDoxDTALBgNVBAMMBHNqMjYxFDAS
|
16
16
|
BgoJkiaJk/IsZAEZFgRzajI2MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkq
|
17
17
|
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr60Eo/ttCk8GMTMFiPr3GoYMIMFvLak
|
18
18
|
xSmTk9YGCB6UiEePB4THSSA5w6IPyeaCF/nWkDp3/BAam0eZMWG1IzYQB23TqIM0
|
@@ -21,14 +21,14 @@ cert_chain:
|
|
21
21
|
4O/FL2ChjL2CPCpLZW55ShYyrzphWJwLOJe+FJ/ZBl6YXwrzQM9HKnt4titSNvyU
|
22
22
|
KzE3L63A3PZvExzLrN9u09kuWLLJfXB2sGOlw3n9t72rJiuBr3/OQQIDAQABozkw
|
23
23
|
NzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU99dfRjEKFyczTeIz
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
m3ZsDWrNC80wDQYJKoZIhvcNAQELBQADggEBAI06Bv7coqIflKtxRIwIJABl3hRR
|
25
|
+
fZ2U0C1T16VXGwGdxRyDJHYt/2aMDfS/bpDzqR0ela2dwTh/29/oZQeAtzbQq6dE
|
26
|
+
7Pax2oYi+dahcreJFndcA6P/dl03XLNVIFVDtfEHvcUjtKKWQALAWirmW7KGAW1R
|
27
|
+
Xn1uy1RJ0TzazCY059p0UQwLU1KXz/5NnTrGka/GvKjLTjk67T6Y05lmr7TxMY2w
|
28
|
+
cTRkS42ilkarelc4DnSSO5jw7qFq7Cmf6F9hMx3xdoSWpLf+FvXJRbYrqwZIsmME
|
29
|
+
V8zEtJFhdNOFOdtcTE67qh/aYQe2y/LDnG9ywXHWdSeF4UUjg1WRt8s3OP8=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2019-11-19 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: nokogiri
|
@@ -50,28 +50,28 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '2.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '2.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: minitest
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
|
122
|
-
rubygems_version: 2.4.5.1
|
121
|
+
rubygems_version: 3.0.4
|
123
122
|
signing_key:
|
124
123
|
specification_version: 4
|
125
124
|
summary: Parse XMP data
|
@@ -127,4 +126,3 @@ test_files:
|
|
127
126
|
- test/fixtures/xmp.xml
|
128
127
|
- test/test_helper.rb
|
129
128
|
- test/xmpr_test.rb
|
130
|
-
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|