exiv2 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -10,3 +10,4 @@ mkmf.log
10
10
  *.dSYM
11
11
  pkg
12
12
  tmp
13
+ bin
data/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p125
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in exiv2.gemspec
4
- gemspec
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exiv2 (0.0.5)
4
+ exiv2 (0.0.7)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/lib/exiv2.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require 'exiv2/exiv2'
2
3
  require 'exiv2/shared_methods'
3
4
  require 'exiv2/exif_data'
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  class Exiv2::ExifData
2
3
  include SharedMethods
3
4
  end
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  class Exiv2::IptcData
2
3
  include SharedMethods
3
4
  end
@@ -1,8 +1,11 @@
1
+ # coding: utf-8
1
2
  module SharedMethods
2
3
  def to_hash
3
4
  result = {}
4
5
 
5
6
  self.each do |key, value|
7
+ key.force_encoding('utf-8')
8
+ value.force_encoding('utf-8')
6
9
  if result[key]
7
10
  if result[key].is_a? Array
8
11
  result[key] << value
data/lib/exiv2/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module Exiv2
2
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
3
4
  end
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  class Exiv2::XmpData
2
3
  include SharedMethods
3
4
  end
data/spec/exiv2_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # coding: utf-8
2
+ require 'bundler/setup'
1
3
  require 'exiv2'
2
4
  require 'fileutils'
3
5
 
@@ -28,6 +30,14 @@ describe Exiv2 do
28
30
  image2.iptc_data["Iptc.Application2.Caption"].should == "A New Caption"
29
31
  FileUtils.rm("spec/files/test_tmp.jpg")
30
32
  end
33
+
34
+ it 'reads UTF-8 data' do
35
+ image = Exiv2::ImageFactory.open(Pathname.new("spec/files/photo_with_utf8_description.jpg").to_s)
36
+ image.read_metadata
37
+ description = image.exif_data["Exif.Image.ImageDescription"]
38
+ description.encoding.should == Encoding::UTF_8
39
+ description.should == 'UTF-8 description. ☃ł㌎'
40
+ end
31
41
 
32
42
  let(:image) do
33
43
  image = Exiv2::ImageFactory.open("spec/files/test.jpg")
metadata CHANGED
@@ -1,62 +1,49 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: exiv2
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 6
10
- version: 0.0.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Pete Yandell
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-11 00:00:00 +11:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rspec
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70104251986840 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: rake-compiler
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70104251986840
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake-compiler
27
+ requirement: &70104251986260 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *70104251986260
49
36
  description: A simple wrapper around the C++ Exiv2 libary for reading image metadata
50
- email:
37
+ email:
51
38
  - pete@envato.com
52
39
  executables: []
53
-
54
- extensions:
40
+ extensions:
55
41
  - ext/exiv2/extconf.rb
56
42
  extra_rdoc_files: []
57
-
58
- files:
43
+ files:
59
44
  - .gitignore
45
+ - .rbenv-version
46
+ - .rspec
60
47
  - Gemfile
61
48
  - Gemfile.lock
62
49
  - LICENSE
@@ -72,42 +59,34 @@ files:
72
59
  - lib/exiv2/version.rb
73
60
  - lib/exiv2/xmp_data.rb
74
61
  - spec/exiv2_spec.rb
62
+ - spec/files/photo_with_utf8_description.jpg
75
63
  - spec/files/test.jpg
76
- has_rdoc: true
77
64
  homepage: https://github.com/envato/exiv2
78
65
  licenses: []
79
-
80
66
  post_install_message:
81
67
  rdoc_options: []
82
-
83
- require_paths:
68
+ require_paths:
84
69
  - lib
85
70
  - ext
86
- required_ruby_version: !ruby/object:Gem::Requirement
71
+ required_ruby_version: !ruby/object:Gem::Requirement
87
72
  none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 3
92
- segments:
93
- - 0
94
- version: "0"
95
- required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
78
  none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
104
83
  requirements: []
105
-
106
84
  rubyforge_project: exiv2
107
- rubygems_version: 1.6.2
85
+ rubygems_version: 1.8.11
108
86
  signing_key:
109
87
  specification_version: 3
110
88
  summary: A simple wrapper around Exiv2
111
- test_files:
89
+ test_files:
112
90
  - spec/exiv2_spec.rb
91
+ - spec/files/photo_with_utf8_description.jpg
113
92
  - spec/files/test.jpg