exif 2.2.0 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ext/exif/data.c +11 -8
- data/ext/exif/data.h +1 -1
- data/ext/exif/exif.c +8 -4
- data/ext/exif/exif_entry_to_ivar.c +64 -0
- data/ext/exif/extconf.rb +17 -0
- data/lib/exif/version.rb +1 -1
- metadata +12 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0de28879ec8434fe5be0f9d0991d964800ea0add8600d405bc6865005185666c
|
4
|
+
data.tar.gz: 39f9aa6a21e95d82b801f59e7453d650335ac8b19141c487640ccae6ac9c7a5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb933cbd6ab8b5487346c4e8f3348df2337176f35b07eeef6bfa79c23ea1c619c0909e804577d2ceb2180796052a8d82e52c6fe33f147a1607ae8628be5a441
|
7
|
+
data.tar.gz: 6f9c748c4f7266f6f4de038cd60cc09fb92f69ceac2ad9faaa2c60c5295c20d2e04ab04463f41f2242f4369a3f31e4f33840eb027020e7f4cbae051850093977
|
data/ext/exif/data.c
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#include "data.h"
|
2
2
|
#include "ruby.h"
|
3
3
|
|
4
|
-
#include <libexif/exif-log.h>
|
5
4
|
#include <libexif/exif-data.h>
|
6
5
|
#include <libexif/exif-loader.h>
|
6
|
+
#include <libexif/exif-log.h>
|
7
7
|
#include <stdint.h>
|
8
8
|
#include <time.h>
|
9
9
|
|
@@ -181,7 +181,7 @@ static void exif_corrupt_log_func(ExifLog *log, ExifLogCode code,
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
|
184
|
-
void init_data() {
|
184
|
+
void init_data(void) {
|
185
185
|
int length;
|
186
186
|
|
187
187
|
rb_cExifData = rb_define_class_under(rb_mExif, "Data", rb_cObject);
|
@@ -208,7 +208,7 @@ VALUE new (VALUE self, VALUE input) {
|
|
208
208
|
ed = exif_data_new();
|
209
209
|
exif_data_log(ed, log);
|
210
210
|
exif_data_load_data(ed, (unsigned char *)RSTRING_PTR(input),
|
211
|
-
RSTRING_LEN(input));
|
211
|
+
(uint32_t)RSTRING_LEN(input));
|
212
212
|
exif_log_unref(log);
|
213
213
|
if (corrupt) {
|
214
214
|
exif_data_free(ed);
|
@@ -222,7 +222,7 @@ VALUE new (VALUE self, VALUE input) {
|
|
222
222
|
if (TYPE(buffer) == T_NIL)
|
223
223
|
break;
|
224
224
|
if (!exif_loader_write(loader, (unsigned char *)RSTRING_PTR(buffer),
|
225
|
-
RSTRING_LEN(buffer)))
|
225
|
+
(uint32_t)RSTRING_LEN(buffer)))
|
226
226
|
break;
|
227
227
|
}
|
228
228
|
ed = exif_loader_get_data(loader);
|
@@ -249,7 +249,6 @@ static VALUE brackets(VALUE self, VALUE ifd_symbol) {
|
|
249
249
|
}
|
250
250
|
|
251
251
|
static void each_content(ExifContent *ec, void *self_ptr) {
|
252
|
-
VALUE *self;
|
253
252
|
ExifIfd ifd;
|
254
253
|
|
255
254
|
ifd = exif_content_get_ifd(ec);
|
@@ -266,6 +265,12 @@ static void each_entry(ExifEntry *entry, void *self_ptr) {
|
|
266
265
|
|
267
266
|
ivar_name = exif_entry_to_ivar(entry);
|
268
267
|
value = exif_entry_to_rb_value(entry);
|
268
|
+
|
269
|
+
if (ivar_name == 0x00) {
|
270
|
+
rb_warning("Unsupported tag %x", entry->tag);
|
271
|
+
return;
|
272
|
+
}
|
273
|
+
|
269
274
|
rb_hash_aset(rb_hash_aref(rb_iv_get(*(VALUE *)self_ptr, "@ifds"),
|
270
275
|
ID2SYM(rb_intern(
|
271
276
|
ifd_name_mapping[exif_entry_get_ifd(entry)]))),
|
@@ -296,10 +301,8 @@ static void each_entry(ExifEntry *entry, void *self_ptr) {
|
|
296
301
|
static VALUE exif_entry_to_rb_value(ExifEntry *entry) {
|
297
302
|
ExifData *data;
|
298
303
|
ExifByteOrder order;
|
299
|
-
ExifRational rational;
|
300
|
-
ExifSRational srational;
|
301
304
|
VALUE ret;
|
302
|
-
size_t
|
305
|
+
size_t i;
|
303
306
|
unsigned char size;
|
304
307
|
|
305
308
|
data = entry->parent->parent;
|
data/ext/exif/data.h
CHANGED
data/ext/exif/exif.c
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
#include "data.h"
|
2
2
|
#include "ruby.h"
|
3
3
|
|
4
|
-
VALUE rb_mExif, rb_eError, rb_eNotReadable, rb_eIFDNotFound,
|
4
|
+
VALUE rb_mExif, rb_eError, rb_eNotReadable, rb_eIFDNotFound,
|
5
|
+
rb_eUnknownDataType;
|
5
6
|
|
6
7
|
VALUE rb_exif_const_missing(VALUE klass, VALUE name) {
|
7
8
|
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
|
9
|
+
if (strcmp(rb_id2name(SYM2ID(name)), not_readble) == 0) {
|
10
|
+
rb_warn("constant NotReadble is deprecated and will be removed in the "
|
11
|
+
"future, use NotReadable instead.");
|
10
12
|
return rb_eNotReadable;
|
11
13
|
}
|
12
14
|
return rb_call_super(1, &name);
|
@@ -20,6 +22,8 @@ void Init_exif(void) {
|
|
20
22
|
rb_eIFDNotFound = rb_define_class_under(rb_mExif, "IFDNotFound", rb_eError);
|
21
23
|
rb_eUnknownDataType =
|
22
24
|
rb_define_class_under(rb_mExif, "UnknownDataType", rb_eError);
|
23
|
-
rb_define_singleton_method(rb_mExif, "const_missing", rb_exif_const_missing,
|
25
|
+
rb_define_singleton_method(rb_mExif, "const_missing", rb_exif_const_missing,
|
26
|
+
1);
|
27
|
+
rb_define_const(rb_mExif, "LIBEXIF_VERSION", rb_str_new2(LIBEXIF_VERSION));
|
24
28
|
init_data();
|
25
29
|
}
|
@@ -447,6 +447,70 @@ const char *exif_entry_to_ivar(ExifEntry *ee) {
|
|
447
447
|
case EXIF_TAG_GPS_DIFFERENTIAL:
|
448
448
|
return "@gps_differential";
|
449
449
|
break;
|
450
|
+
#ifdef LIBEXIF_0_6_22_OR_HIGHER
|
451
|
+
case EXIF_TAG_BODY_SERIAL_NUMBER:
|
452
|
+
return "@body_serial_number";
|
453
|
+
break;
|
454
|
+
case EXIF_TAG_CAMERA_OWNER_NAME:
|
455
|
+
return "@camera_owner_name";
|
456
|
+
break;
|
457
|
+
case EXIF_TAG_COMPOSITE_IMAGE:
|
458
|
+
return "@composite_image";
|
459
|
+
break;
|
460
|
+
case EXIF_TAG_GPS_H_POSITIONING_ERROR:
|
461
|
+
return "@gps_h_positioning_error";
|
462
|
+
break;
|
463
|
+
case EXIF_TAG_LENS_MAKE:
|
464
|
+
return "@lens_make";
|
465
|
+
break;
|
466
|
+
case EXIF_TAG_LENS_MODEL:
|
467
|
+
return "@lens_model";
|
468
|
+
break;
|
469
|
+
case EXIF_TAG_LENS_SERIAL_NUMBER:
|
470
|
+
return "@lens_serial_number";
|
471
|
+
break;
|
472
|
+
case EXIF_TAG_LENS_SPECIFICATION:
|
473
|
+
return "@lens_specification";
|
474
|
+
break;
|
475
|
+
case EXIF_TAG_SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE:
|
476
|
+
return "@source_exposure_times_of_composite_image";
|
477
|
+
break;
|
478
|
+
case EXIF_TAG_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE:
|
479
|
+
return "@source_image_number_of_composite_image";
|
480
|
+
break;
|
481
|
+
#endif
|
482
|
+
#ifdef LIBEXIF_0_6_23_OR_HIGHER
|
483
|
+
case EXIF_TAG_IMAGE_DEPTH:
|
484
|
+
return "@image_depth";
|
485
|
+
break;
|
486
|
+
case EXIF_TAG_ISO_SPEED:
|
487
|
+
return "@iso_speed";
|
488
|
+
break;
|
489
|
+
case EXIF_TAG_ISO_SPEEDLatitudeYYY:
|
490
|
+
return "@iso_speedlatitudeyyy";
|
491
|
+
break;
|
492
|
+
case EXIF_TAG_ISO_SPEEDLatitudeZZZ:
|
493
|
+
return "@iso_speedlatitudezzz";
|
494
|
+
break;
|
495
|
+
case EXIF_TAG_OFFSET_TIME:
|
496
|
+
return "@offset_time";
|
497
|
+
break;
|
498
|
+
case EXIF_TAG_OFFSET_TIME_DIGITIZED:
|
499
|
+
return "@offset_time_digitized";
|
500
|
+
break;
|
501
|
+
case EXIF_TAG_OFFSET_TIME_ORIGINAL:
|
502
|
+
return "@offset_time_original";
|
503
|
+
break;
|
504
|
+
case EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX:
|
505
|
+
return "@recommended_exposure_index";
|
506
|
+
break;
|
507
|
+
case EXIF_TAG_SENSITIVITY_TYPE:
|
508
|
+
return "@sensitivity_type";
|
509
|
+
break;
|
510
|
+
case EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY:
|
511
|
+
return "@standard_output_sensitivity";
|
512
|
+
break;
|
513
|
+
#endif
|
450
514
|
}
|
451
515
|
return 0;
|
452
516
|
}
|
data/ext/exif/extconf.rb
CHANGED
@@ -2,6 +2,23 @@
|
|
2
2
|
|
3
3
|
require 'mkmf'
|
4
4
|
$CFLAGS << ' -std=c99 '
|
5
|
+
pkg_config('libexif')
|
5
6
|
have_library('exif')
|
6
7
|
have_header('libexif/exif-data.h')
|
8
|
+
|
9
|
+
checking_for 'libexif >= 0.6.22' do
|
10
|
+
if try_const(%w[EXIF_TAG_LENS_SPECIFICATION ExifTag], 'libexif/exif-tag.h')
|
11
|
+
append_cflags('-D LIBEXIF_0_6_22_OR_HIGHER')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
checking_for 'libexif >= 0.6.23' do
|
16
|
+
if try_const(%w[EXIF_TAG_IMAGE_DEPTH ExifTag], 'libexif/exif-tag.h')
|
17
|
+
append_cflags('-D LIBEXIF_0_6_23_OR_HIGHER')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
libexif_version = pkg_config('libexif', 'modversion') || 'unknown'
|
22
|
+
append_cflags("-D LIBEXIF_VERSION='\"#{libexif_version}\"'")
|
23
|
+
|
7
24
|
create_makefile('exif/exif')
|
data/lib/exif/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.15.4
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.15.4
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - "
|
17
|
+
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
19
|
+
version: 0.8.1
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - "
|
24
|
+
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
26
|
+
version: 0.8.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake-compiler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +44,14 @@ dependencies:
|
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 5.
|
47
|
+
version: 5.11.3
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 5.
|
54
|
+
version: 5.11.3
|
69
55
|
description: Ruby EXIF reader written in C extension.
|
70
56
|
email: tonytonyjan@gmail.com
|
71
57
|
executables: []
|
@@ -84,7 +70,7 @@ homepage: https://github.com/tonytonyjan/exif
|
|
84
70
|
licenses:
|
85
71
|
- MIT
|
86
72
|
metadata: {}
|
87
|
-
post_install_message:
|
73
|
+
post_install_message:
|
88
74
|
rdoc_options: []
|
89
75
|
require_paths:
|
90
76
|
- lib
|
@@ -99,9 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
85
|
- !ruby/object:Gem::Version
|
100
86
|
version: '0'
|
101
87
|
requirements: []
|
102
|
-
|
103
|
-
|
104
|
-
signing_key:
|
88
|
+
rubygems_version: 3.3.7
|
89
|
+
signing_key:
|
105
90
|
specification_version: 4
|
106
91
|
summary: Ruby EXIF reader written in C extension.
|
107
92
|
test_files: []
|