libjpeg-ruby 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/jpeg/jpeg.c +43 -5
- data/lib/jpeg/version.rb +1 -1
- data/libjpeg-ruby.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b783545e4e23157c5af066c2f8d39add455c906d4f60556819fc74aed68a9fa5
|
4
|
+
data.tar.gz: 56e3776fcfa3d31cceb0b96cce74495058722f20032dc7586045cd2ba0df954e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801f18210f83e85865672dda23cf832d20a2354a6f7c13d38c5e7f297f76e6477c9481cec7000f45816577eeddc333fa0d8871e2b129e008337c89a867260735
|
7
|
+
data.tar.gz: aa5a7cc6a9830253ea800429ee95f802cbf6ec8cc1c634ab802c4507e79721c22bdb39ccd3f3ea3b6d23e6b83eab633e6f5cda438530f9006af6a45fdf968260
|
data/ext/jpeg/jpeg.c
CHANGED
@@ -2129,7 +2129,7 @@ get_colorspace_str( J_COLOR_SPACE cs)
|
|
2129
2129
|
break;
|
2130
2130
|
}
|
2131
2131
|
|
2132
|
-
return rb_str_new_cstr(cstr);
|
2132
|
+
return rb_str_freeze(rb_str_new_cstr(cstr));
|
2133
2133
|
}
|
2134
2134
|
|
2135
2135
|
typedef struct {
|
@@ -2325,6 +2325,8 @@ exif_fetch_byte_data(exif_t* ptr, VALUE* dst)
|
|
2325
2325
|
for (i = 0; i < (int)n; i++) {
|
2326
2326
|
rb_ary_push(obj, INT2FIX(p[i]));
|
2327
2327
|
}
|
2328
|
+
|
2329
|
+
rb_ary_freeze(obj);
|
2328
2330
|
break;
|
2329
2331
|
}
|
2330
2332
|
|
@@ -2348,6 +2350,7 @@ exif_fetch_ascii_data(exif_t* ptr, VALUE* dst)
|
|
2348
2350
|
|
2349
2351
|
obj = rb_utf8_str_new((char*)p, n);
|
2350
2352
|
rb_funcall(obj, rb_intern("strip!"), 0);
|
2353
|
+
rb_str_freeze(obj);
|
2351
2354
|
|
2352
2355
|
*dst = obj;
|
2353
2356
|
}
|
@@ -2382,6 +2385,8 @@ exif_fetch_short_data(exif_t* ptr, VALUE* dst)
|
|
2382
2385
|
rb_ary_push(obj, INT2FIX(get_u16(p, ptr->be)));
|
2383
2386
|
p += 2;
|
2384
2387
|
}
|
2388
|
+
|
2389
|
+
rb_ary_freeze(obj);
|
2385
2390
|
break;
|
2386
2391
|
}
|
2387
2392
|
|
@@ -2416,6 +2421,8 @@ exif_fetch_long_data(exif_t* ptr, VALUE* dst)
|
|
2416
2421
|
rb_ary_push(obj, INT2FIX(get_u32(p, ptr->be)));
|
2417
2422
|
p += 4;
|
2418
2423
|
}
|
2424
|
+
|
2425
|
+
rb_ary_freeze(obj);
|
2419
2426
|
break;
|
2420
2427
|
}
|
2421
2428
|
|
@@ -2426,6 +2433,7 @@ static void
|
|
2426
2433
|
exif_fetch_rational_data(exif_t* ptr, VALUE* dst)
|
2427
2434
|
{
|
2428
2435
|
VALUE obj;
|
2436
|
+
VALUE val;
|
2429
2437
|
|
2430
2438
|
int i;
|
2431
2439
|
uint32_t n;
|
@@ -2448,6 +2456,7 @@ exif_fetch_rational_data(exif_t* ptr, VALUE* dst)
|
|
2448
2456
|
deno = 1;
|
2449
2457
|
}
|
2450
2458
|
obj = rb_rational_new(INT2FIX(num), INT2FIX(deno));
|
2459
|
+
rb_obj_freeze(obj);
|
2451
2460
|
break;
|
2452
2461
|
|
2453
2462
|
default:
|
@@ -2458,9 +2467,15 @@ exif_fetch_rational_data(exif_t* ptr, VALUE* dst)
|
|
2458
2467
|
if (num == 0 && deno == 0) {
|
2459
2468
|
deno = 1;
|
2460
2469
|
}
|
2461
|
-
|
2470
|
+
|
2471
|
+
val = rb_rational_new(INT2FIX(num), INT2FIX(deno));
|
2472
|
+
rb_obj_freeze(val);
|
2473
|
+
|
2474
|
+
rb_ary_push(obj, val);
|
2462
2475
|
p += 8;
|
2463
2476
|
}
|
2477
|
+
|
2478
|
+
rb_ary_freeze(obj);
|
2464
2479
|
break;
|
2465
2480
|
}
|
2466
2481
|
|
@@ -2483,6 +2498,7 @@ exif_fetch_undefined_data(exif_t* ptr, VALUE* dst)
|
|
2483
2498
|
}
|
2484
2499
|
|
2485
2500
|
obj = rb_enc_str_new((char*)p, n, rb_ascii8bit_encoding());
|
2501
|
+
rb_str_freeze(obj);
|
2486
2502
|
|
2487
2503
|
*dst = obj;
|
2488
2504
|
}
|
@@ -2515,6 +2531,8 @@ exif_fetch_slong_data(exif_t* ptr, VALUE* dst)
|
|
2515
2531
|
rb_ary_push(obj, INT2FIX(get_s32(p, ptr->be)));
|
2516
2532
|
p += 4;
|
2517
2533
|
}
|
2534
|
+
|
2535
|
+
rb_ary_freeze(obj);
|
2518
2536
|
break;
|
2519
2537
|
}
|
2520
2538
|
|
@@ -2525,6 +2543,7 @@ static void
|
|
2525
2543
|
exif_fetch_srational_data(exif_t* ptr, VALUE* dst)
|
2526
2544
|
{
|
2527
2545
|
VALUE obj;
|
2546
|
+
VALUE val;
|
2528
2547
|
|
2529
2548
|
int i;
|
2530
2549
|
uint32_t n;
|
@@ -2557,9 +2576,15 @@ exif_fetch_srational_data(exif_t* ptr, VALUE* dst)
|
|
2557
2576
|
if (num == 0 && deno == 0) {
|
2558
2577
|
deno = 1;
|
2559
2578
|
}
|
2560
|
-
|
2579
|
+
|
2580
|
+
val = rb_rational_new(INT2FIX(num), INT2FIX(deno));
|
2581
|
+
rb_obj_freeze(val);
|
2582
|
+
|
2583
|
+
rb_ary_push(obj, val);
|
2561
2584
|
p += 8;
|
2562
2585
|
}
|
2586
|
+
|
2587
|
+
rb_ary_freeze(obj);
|
2563
2588
|
break;
|
2564
2589
|
}
|
2565
2590
|
|
@@ -2720,7 +2745,10 @@ create_exif_tags_hash(jpeg_decode_t* ptr)
|
|
2720
2745
|
|
2721
2746
|
if (TYPE(off) == T_FIXNUM && TYPE(size) == T_FIXNUM) {
|
2722
2747
|
data = rb_enc_str_new((char*)exif.head + FIX2INT(off),
|
2723
|
-
FIX2INT(size),
|
2748
|
+
FIX2INT(size),
|
2749
|
+
rb_ascii8bit_encoding());
|
2750
|
+
|
2751
|
+
rb_str_freeze(data);
|
2724
2752
|
|
2725
2753
|
rb_hash_lookup(info, THUMBNAIL_OFFSET);
|
2726
2754
|
rb_hash_lookup(info, THUMBNAIL_SIZE);
|
@@ -2731,6 +2759,8 @@ create_exif_tags_hash(jpeg_decode_t* ptr)
|
|
2731
2759
|
break;
|
2732
2760
|
}
|
2733
2761
|
|
2762
|
+
rb_hash_freeze(ret);
|
2763
|
+
|
2734
2764
|
return ret;
|
2735
2765
|
}
|
2736
2766
|
|
@@ -2861,6 +2891,8 @@ create_colormap(jpeg_decode_t* ptr)
|
|
2861
2891
|
RUNTIME_ERROR("this number of components is not implemented yet");
|
2862
2892
|
}
|
2863
2893
|
|
2894
|
+
rb_ary_freeze(ret);
|
2895
|
+
|
2864
2896
|
return ret;
|
2865
2897
|
}
|
2866
2898
|
|
@@ -2899,7 +2931,7 @@ create_meta(jpeg_decode_t* ptr)
|
|
2899
2931
|
rb_ivar_set(ret, id_orig_cs, get_colorspace_str(cinfo->jpeg_color_space));
|
2900
2932
|
|
2901
2933
|
if (ptr->format == FMT_YVU) {
|
2902
|
-
rb_ivar_set(ret, id_out_cs, rb_str_new_cstr("YCrCb"));
|
2934
|
+
rb_ivar_set(ret, id_out_cs, rb_str_freeze(rb_str_new_cstr("YCrCb")));
|
2903
2935
|
} else {
|
2904
2936
|
rb_ivar_set(ret, id_out_cs, get_colorspace_str(cinfo->out_color_space));
|
2905
2937
|
}
|
@@ -2919,6 +2951,8 @@ create_meta(jpeg_decode_t* ptr)
|
|
2919
2951
|
if (TEST_FLAG(ptr, F_DITHER)) {
|
2920
2952
|
rb_ivar_set(ret, id_colormap, create_colormap(ptr));
|
2921
2953
|
}
|
2954
|
+
|
2955
|
+
rb_obj_freeze(ret);
|
2922
2956
|
|
2923
2957
|
return ret;
|
2924
2958
|
}
|
@@ -3701,6 +3735,10 @@ Init_jpeg()
|
|
3701
3735
|
{
|
3702
3736
|
int i;
|
3703
3737
|
|
3738
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
3739
|
+
rb_ext_ractor_safe(true);
|
3740
|
+
#endif /* defined(HAVE_RB_EXT_RACTOR_SAFE) */
|
3741
|
+
|
3704
3742
|
module = rb_define_module("JPEG");
|
3705
3743
|
rb_define_singleton_method(module, "broken?", rb_test_image, 1);
|
3706
3744
|
|
data/lib/jpeg/version.rb
CHANGED
data/libjpeg-ruby.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
spec.required_ruby_version = ">= 2.4.0"
|
36
36
|
|
37
|
-
spec.add_development_dependency "bundler", ">= 2.
|
38
|
-
spec.add_development_dependency "rake", ">=
|
37
|
+
spec.add_development_dependency "bundler", ">= 2.3"
|
38
|
+
spec.add_development_dependency "rake", ">= 13.0"
|
39
39
|
spec.add_development_dependency "rake-compiler", "~> 1.1.0"
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libjpeg-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Kuwagata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.3.7
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: libjpeg interface for ruby
|