libpng-ruby 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7065dd93f08e6f53cce0a60e91bda0fdbfe9fd305d4bea5e35dc5a82f5e87f75
4
- data.tar.gz: 9bda38b5eb8d4c70a269ec574fd1a9db7dabb1ffd8004da6adc6e9e0fe16197e
3
+ metadata.gz: 5a7a14159672b5baccc3dc51269db0f83b942d57062d970d1b4870cdf560f3a8
4
+ data.tar.gz: e923bf2f1a1e4fb42b51808949baee393cbbb8e7f3dc51b61b69f9927ef4dfcb
5
5
  SHA512:
6
- metadata.gz: 174bcdf1fb51539d63ce18b6a32abeb7b484052ada9086106259fba1c6a7e99e740a97fb2a4f3c52fdbeac577114760ee86acbbf5f0722da199a526e236f0334
7
- data.tar.gz: 33d169bc03a3e7cf778f2588529d1f450ff9b4af794b54780562916d5e29be0870f704d351e46d9499c70e558ae1ec9548c9dd014caefd195df3dc4ae3046942
6
+ metadata.gz: b89324c661cba887d6de37719d8131236f6801e3ebe266ee029cbd19e58ea1e05a2fa8f995e716b4dc347055e318bc68bf3829e69f3c64a8ecf3cc4a54cb4b15
7
+ data.tar.gz: 2d236ed145212e145d7eba5a02d8fc5ae24da0b998a61054a5ad314dff06d050b25edf1a5ee75c9478e879ccb9b647a5526a13e9148aa3f30475fa69b1eaa78f
data/README.md CHANGED
@@ -26,7 +26,7 @@ If you need to specify the libpng path, use the following options:
26
26
  ```ruby
27
27
  require 'png'
28
28
 
29
- dec = PNG::Decoder.new(:color_type => :BGR)
29
+ dec = PNG::Decoder.new(:pixel_format => :BGR)
30
30
 
31
31
  p dec.read_header(IO.binread("test.png"))
32
32
 
data/ext/png/png.c CHANGED
@@ -4,6 +4,10 @@
4
4
  * Copyright (C) 2016 Hiroshi Kuwagata <kgt9221@gmail.com>
5
5
  */
6
6
 
7
+ #ifdef __GNUC__
8
+ #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
9
+ #endif /* defined(__GNUC__) */
10
+
7
11
  #include <stdio.h>
8
12
  #include <stdint.h>
9
13
  #include <string.h>
@@ -1516,7 +1520,7 @@ get_color_type_str(png_decoder_t* ptr)
1516
1520
  break;
1517
1521
  }
1518
1522
 
1519
- return rb_str_new_cstr(cstr);
1523
+ return rb_str_freeze(rb_str_new_cstr(cstr));
1520
1524
  }
1521
1525
 
1522
1526
  static VALUE
@@ -1540,7 +1544,7 @@ get_interlace_method_str(png_decoder_t* ptr)
1540
1544
  break;
1541
1545
  }
1542
1546
 
1543
- return rb_str_new_cstr(cstr);
1547
+ return rb_str_freeze(rb_str_new_cstr(cstr));
1544
1548
  }
1545
1549
 
1546
1550
  static VALUE
@@ -1560,7 +1564,7 @@ get_compression_method_str(png_decoder_t* ptr)
1560
1564
  break;
1561
1565
  }
1562
1566
 
1563
- return rb_str_new_cstr(cstr);
1567
+ return rb_str_freeze(rb_str_new_cstr(cstr));
1564
1568
  }
1565
1569
 
1566
1570
  static VALUE
@@ -1584,7 +1588,7 @@ get_filter_method_str(png_decoder_t* ptr)
1584
1588
  break;
1585
1589
  }
1586
1590
 
1587
- return rb_str_new_cstr(cstr);
1591
+ return rb_str_freeze(rb_str_new_cstr(cstr));
1588
1592
  }
1589
1593
 
1590
1594
  static VALUE
@@ -1603,12 +1607,17 @@ create_text_meta(png_decoder_t* ptr)
1603
1607
  val = rb_str_new(ptr->classic.text[i].text,
1604
1608
  ptr->classic.text[i].text_length);
1605
1609
 
1610
+ rb_str_freeze(key);
1611
+ rb_str_freeze(val);
1612
+
1606
1613
  rb_funcall(key, rb_intern("downcase!"), 0);
1607
1614
  rb_funcall(key, rb_intern("gsub!"), 2, rb_str_new2(" "), rb_str_new2("_"));
1608
1615
 
1609
1616
  rb_hash_aset(ret, rb_to_symbol(key), val);
1610
1617
  }
1611
1618
 
1619
+ rb_obj_freeze(ret);
1620
+
1612
1621
  return ret;
1613
1622
  }
1614
1623
 
@@ -1629,6 +1638,8 @@ create_time_meta(png_decoder_t* ptr)
1629
1638
 
1630
1639
  rb_funcall(ret, rb_intern("localtime"), 0);
1631
1640
 
1641
+ rb_obj_freeze(ret);
1642
+
1632
1643
  return ret;
1633
1644
  }
1634
1645
 
@@ -1666,6 +1677,8 @@ create_meta(png_decoder_t* ptr)
1666
1677
  DBL2NUM(ptr->classic.file_gamma));
1667
1678
  }
1668
1679
 
1680
+ rb_obj_freeze(ret);
1681
+
1669
1682
  return ret;
1670
1683
  }
1671
1684
 
@@ -1739,9 +1752,11 @@ create_tiny_meta(png_decoder_t* ptr)
1739
1752
  break;
1740
1753
  }
1741
1754
 
1742
- rb_ivar_set(ret, id_pixfmt, rb_str_new_cstr(fmt));
1755
+ rb_ivar_set(ret, id_pixfmt, rb_str_freeze(rb_str_new_cstr(fmt)));
1743
1756
  rb_ivar_set(ret, id_ncompo, INT2FIX(nc));
1744
1757
 
1758
+ rb_obj_freeze(ret);
1759
+
1745
1760
  return ret;
1746
1761
  }
1747
1762
 
@@ -2092,6 +2107,10 @@ Init_png()
2092
2107
  {
2093
2108
  int i;
2094
2109
 
2110
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
2111
+ rb_ext_ractor_safe(true);
2112
+ #endif /* defined(HAVE_RB_EXT_RACTOR_SAFE) */
2113
+
2095
2114
  module = rb_define_module("PNG");
2096
2115
 
2097
2116
  encoder_klass = rb_define_class_under(module, "Encoder", rb_cObject);
data/lib/png/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PNG
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/libpng-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.1"
38
- spec.add_development_dependency "rake", ">= 10.0"
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: libpng-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.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: 2021-01-14 00:00:00.000000000 Z
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.1'
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.1'
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: '10.0'
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: '10.0'
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.2.3
93
+ rubygems_version: 3.3.7
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: libpng interface for ruby