exif 0.11.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -16
- data/benchmark/benchmark.rb +9 -5
- data/lib/exif/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d039e9781e3484977eaa1f57d34d5fdeb3c7422a
|
4
|
+
data.tar.gz: 36d459ec69a08973f845931d827bf690dd494ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5c9f0d2a64c4d345512dd50476d32231be8fa1cb4aaed0e7f9c350b26f0c4c1d38a2ad172f25644243cb4ae59e6051aa31b1f0b682e983722456afe8343eae
|
7
|
+
data.tar.gz: 0da8b96a388e365dfeee2d9d0bca6cd24f761a3018a6d91299b957f6831281c1acaa367df87570821f815709fdab0ac3ec7dc31f29578d61b1928b6924e1347e
|
data/README.md
CHANGED
@@ -4,7 +4,10 @@ Ruby EXIF reader written in C extension.
|
|
4
4
|
|
5
5
|
$ gem install exif
|
6
6
|
|
7
|
-
Please make sure you have installed `libexif` first
|
7
|
+
Please make sure you have installed `libexif` first:
|
8
|
+
|
9
|
+
$ brew install libexif # Homebrew
|
10
|
+
$ sudo apt-get install libexif-dev # APT
|
8
11
|
|
9
12
|
# Usage
|
10
13
|
|
@@ -26,19 +29,28 @@ data.to_h # => {0 => {...}, 1 => {...}, :exif => {...}}
|
|
26
29
|
|
27
30
|
# How fast?
|
28
31
|
|
29
|
-
There
|
32
|
+
There are some other excellent works called [exifr](https://github.com/remvee/exifr) by [@remvee](https://github.com/remvee), and [mini_exiftool](https://github.com/janfri/mini_exiftool) by [@janfri](https://github.com/janfri). They're built in pure Ruby while this one is C extension.
|
33
|
+
|
34
|
+
If you program JRuby, you may want to choose exifr or mini_exiftool, the latter lets you get the full power of [Exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/) written by Phil Harvey since it's a command-line wrapper, otherwise you can try this gem for speed purpose. **It's about 8 times faster than exifr and 1200 times than that of mini_exiftool.**
|
35
|
+
|
36
|
+
A small benchmark shows below:
|
30
37
|
|
31
38
|
```ruby
|
32
39
|
require 'benchmark'
|
33
|
-
require '
|
40
|
+
require 'mini_exiftool'
|
34
41
|
require 'exifr'
|
35
|
-
|
36
|
-
|
42
|
+
require 'exif'
|
43
|
+
|
44
|
+
N = 50
|
45
|
+
FILE_PATH = File.expand_path('../../spec/sample.jpg', __FILE__)
|
37
46
|
Benchmark.bmbm do |x|
|
38
|
-
x.report '
|
47
|
+
x.report 'mini_exiftool' do
|
48
|
+
N.times{ MiniExiftool.new(FILE_PATH).image_width }
|
49
|
+
end
|
50
|
+
x.report 'exifr' do
|
39
51
|
N.times{ EXIFR::JPEG.new(FILE_PATH).width }
|
40
52
|
end
|
41
|
-
x.report '
|
53
|
+
x.report 'exif' do
|
42
54
|
N.times{ Exif::Data.new(FILE_PATH).image_width }
|
43
55
|
end
|
44
56
|
end
|
@@ -46,14 +58,15 @@ end
|
|
46
58
|
|
47
59
|
```
|
48
60
|
$ ruby benchmark/benchmark.rb
|
49
|
-
Rehearsal
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
61
|
+
Rehearsal -------------------------------------------------
|
62
|
+
mini_exiftool 0.150000 0.050000 12.390000 ( 12.546417)
|
63
|
+
exifr 0.090000 0.000000 0.090000 ( 0.091090)
|
64
|
+
exif 0.010000 0.000000 0.010000 ( 0.010343)
|
65
|
+
--------------------------------------- total: 12.490000sec
|
66
|
+
user system total real
|
67
|
+
mini_exiftool 0.150000 0.050000 12.400000 ( 12.540122)
|
68
|
+
exifr 0.080000 0.000000 0.080000 ( 0.083251)
|
69
|
+
exif 0.010000 0.000000 0.010000 ( 0.009855)
|
57
70
|
```
|
58
71
|
|
59
72
|
## Tag Rreference
|
@@ -209,4 +222,5 @@ Rehearsal ------------------------------------------------
|
|
209
222
|
|
210
223
|
# TODO
|
211
224
|
|
212
|
-
1. Support reading from String.
|
225
|
+
1. Support reading from String.
|
226
|
+
2. Create, update and delete tags.
|
data/benchmark/benchmark.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
$: << File.expand_path('../../lib', __FILE__)
|
2
2
|
require 'benchmark'
|
3
|
-
require '
|
3
|
+
require 'mini_exiftool'
|
4
4
|
require 'exifr'
|
5
|
+
require 'exif'
|
5
6
|
|
6
|
-
N =
|
7
|
+
N = 50
|
7
8
|
FILE_PATH = File.expand_path('../../spec/sample.jpg', __FILE__)
|
8
9
|
Benchmark.bmbm do |x|
|
9
|
-
x.report '
|
10
|
+
x.report 'mini_exiftool' do
|
11
|
+
N.times{ MiniExiftool.new(FILE_PATH).image_width }
|
12
|
+
end
|
13
|
+
x.report 'exifr' do
|
10
14
|
N.times{ EXIFR::JPEG.new(FILE_PATH).width }
|
11
15
|
end
|
12
|
-
x.report '
|
16
|
+
x.report 'exif' do
|
13
17
|
N.times{ Exif::Data.new(FILE_PATH).image_width }
|
14
18
|
end
|
15
|
-
end
|
19
|
+
end
|
data/lib/exif/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|