exif 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/exif/data.c +5 -9
- data/ext/exif/exif.c +12 -3
- data/lib/exif/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c95ed5bae94cb0ba692cc6e2c8f78a24919fd0
|
4
|
+
data.tar.gz: 03eddb0662aefd46ef6d746e6df5e33a70d25df2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15be77ed432c2d18fa63b5cdccfeb0349967b8b87851061dd0c296bb4a773e2eedd8e16411896489ca7e70ef4be6df646ed06a70a933f040131985c3bc301492
|
7
|
+
data.tar.gz: e931603d06c4702e4bfc44bf74eb73b22ae4e2f88b4253c6a1402ec85fcb6f0513bd023a46fb499904e598a5297b6177f562105815a38ff0765c4fe1541fa00d
|
data/ext/exif/data.c
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
#include <stdint.h>
|
7
7
|
#include <time.h>
|
8
8
|
|
9
|
-
extern VALUE rb_mExif,
|
9
|
+
extern VALUE rb_mExif, rb_eNotReadable, rb_eIFDNotFound;
|
10
10
|
extern const char *exif_entry_to_ivar(ExifEntry *entry);
|
11
11
|
|
12
12
|
VALUE rb_cExifData;
|
@@ -188,17 +188,13 @@ VALUE new (VALUE self, VALUE input) {
|
|
188
188
|
ExifData *ed;
|
189
189
|
VALUE read_data;
|
190
190
|
|
191
|
-
|
192
|
-
case T_STRING:
|
191
|
+
if (TYPE(input) == T_STRING)
|
193
192
|
read_data = input;
|
194
|
-
|
195
|
-
case T_FILE:
|
193
|
+
else if (rb_respond_to(input, rb_intern("read")))
|
196
194
|
read_data = rb_funcall(input, rb_intern("read"), 0);
|
197
|
-
|
198
|
-
default:
|
195
|
+
else
|
199
196
|
rb_raise(rb_eTypeError, "wrong argument type %s (expected String or IO)",
|
200
197
|
rb_obj_classname(input));
|
201
|
-
}
|
202
198
|
|
203
199
|
ExifLoader *loader = exif_loader_new();
|
204
200
|
exif_loader_write(loader, (unsigned char *)RSTRING_PTR(read_data),
|
@@ -206,7 +202,7 @@ VALUE new (VALUE self, VALUE input) {
|
|
206
202
|
ed = exif_loader_get_data(loader);
|
207
203
|
exif_loader_unref(loader);
|
208
204
|
if (!ed)
|
209
|
-
rb_raise(
|
205
|
+
rb_raise(rb_eNotReadable, "File not readable or no EXIF data in file.");
|
210
206
|
|
211
207
|
VALUE rb_data = Data_Wrap_Struct(self, NULL, exif_data_free, ed);
|
212
208
|
rb_iv_set(rb_data, "@ifds", rb_hash_new());
|
data/ext/exif/exif.c
CHANGED
@@ -1,16 +1,25 @@
|
|
1
1
|
#include "data.h"
|
2
2
|
#include "ruby.h"
|
3
3
|
|
4
|
-
VALUE rb_mExif, rb_eError,
|
4
|
+
VALUE rb_mExif, rb_eError, rb_eNotReadable, rb_eIFDNotFound, rb_eUnknownDataType;
|
5
|
+
|
6
|
+
VALUE rb_exif_const_missing(VALUE klass, VALUE name) {
|
7
|
+
const char not_readble[] = "NotReadble";
|
8
|
+
if(strcmp(rb_id2name(SYM2ID(name)), not_readble) == 0) {
|
9
|
+
rb_warn("constant NotReadble is deprecated and will be removed in the future, use NotReadable instead.");
|
10
|
+
return rb_eNotReadable;
|
11
|
+
}
|
12
|
+
return rb_call_super(1, &name);
|
13
|
+
}
|
5
14
|
|
6
15
|
void Init_exif(void) {
|
7
16
|
rb_mExif = rb_define_module("Exif");
|
8
17
|
|
9
18
|
rb_eError = rb_define_class_under(rb_mExif, "Error", rb_eStandardError);
|
10
|
-
|
19
|
+
rb_eNotReadable = rb_define_class_under(rb_mExif, "NotReadable", rb_eError);
|
11
20
|
rb_eIFDNotFound = rb_define_class_under(rb_mExif, "IFDNotFound", rb_eError);
|
12
21
|
rb_eUnknownDataType =
|
13
22
|
rb_define_class_under(rb_mExif, "UnknownDataType", rb_eError);
|
14
|
-
|
23
|
+
rb_define_singleton_method(rb_mExif, "const_missing", rb_exif_const_missing, 1);
|
15
24
|
init_data();
|
16
25
|
}
|
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: 2.0
|
4
|
+
version: 2.1.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: 2017-10-
|
11
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.6.
|
103
|
+
rubygems_version: 2.6.14
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Ruby EXIF reader written in C extension.
|