image_size 2.1.1 → 2.1.2

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: 0d1cc3c97861cbc7a37da6dec311e295f9346d0deafcc60849a510e68e37f837
4
- data.tar.gz: 39cf76b211c6835dcbc9f47c64f79200ce792843e689a07408f17a2a1c4056e0
3
+ metadata.gz: 1e5bf43db03f3e3f62465528a32d65b65592240db8756ef759f17b6b2d0c1f14
4
+ data.tar.gz: 4b5cfe6468ba3208528c971ce0873760688dd6a59f170d20fe5dc2934a4ca5ff
5
5
  SHA512:
6
- metadata.gz: 852bc4a878bfa126137a1d1e803a5745543fd3002711dcf412de18a78911328ece53682841b1fbac87070c18473bf593def41736003db914364a8915cbc3ab1f
7
- data.tar.gz: 8f21bc66016e5bfe3bd0f21504926cbc22b5e62ad090f1b9484b0ea7123ee55235de97217bc9d8fe4f42f545bf9cf61bb1b191dad1b8eefa6868a1f80f3d900c
6
+ metadata.gz: 18e0d5c54eb5a89ec5412f7b8094fe154d02f609f0d1dc217881a9bde7236d35ac7a9fe3f4c0f82d33c57c35d9368ca0c03c411a3b2d4f09f174ed4633f7dbed
7
+ data.tar.gz: 4685c93339d37b5d4b59caa697885cad1bfff21c934f0e243abcb7814eb9262bd5ecfbe7f8fcc12e8bd207aa2a1711a5bfa5f764ee74e6ddf31a4b1e926f0744
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v2.1.2 (2021-08-21)
6
+
7
+ * Fix for pcx on big endian systems by forcing reading dimensions in little endian byte order [#15](https://github.com/toy/image_size/issues/15) [#16](https://github.com/toy/image_size/pull/16) [@mtasaka](https://github.com/mtasaka)
8
+
5
9
  ## v2.1.1 (2021-07-04)
6
10
 
7
11
  * Add actual license texts, assuming old dual Ruby/GPLv2 license [#14](https://github.com/toy/image_size/issues/14) [@toy](https://github.com/toy)
data/README.markdown CHANGED
@@ -1,5 +1,5 @@
1
- [![Gem Version](https://img.shields.io/gem/v/image_size.svg?style=flat)](https://rubygems.org/gems/image_size)
2
- [![Build Status](https://github.com/toy/image_size/actions/workflows/check.yml/badge.svg)](https://github.com/toy/image_size/actions/workflows/check.yml)
1
+ [![Gem Version](https://img.shields.io/gem/v/image_size?logo=rubygems)](https://rubygems.org/gems/image_size)
2
+ [![Build Status](https://img.shields.io/github/workflow/status/toy/image_size/check/master?logo=github)](https://github.com/toy/image_size/actions/workflows/check.yml)
3
3
 
4
4
  # image_size
5
5
 
data/image_size.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_size'
5
- s.version = '2.1.1'
5
+ s.version = '2.1.2'
6
6
  s.summary = %q{Measure image size using pure Ruby}
7
7
  s.description = %q{Measure following file dimensions: apng, bmp, cur, gif, ico, j2c, jp2, jpeg, jpx, mng, pam, pbm, pcx, pgm, png, ppm, psd, svg, swf, tiff, webp, xbm, xpm}
8
8
  s.homepage = "https://github.com/toy/#{s.name}"
data/lib/image_size.rb CHANGED
@@ -164,11 +164,11 @@ private
164
164
  end
165
165
  alias_method :size_of_apng, :size_of_png
166
166
 
167
- JPEG_CODE_CHECK = %W[
168
- \xC0 \xC1 \xC2 \xC3
169
- \xC5 \xC6 \xC7
170
- \xC9 \xCA \xCB
171
- \xCD \xCE \xCF
167
+ JPEG_CODE_CHECK = [
168
+ 0xC0, 0xC1, 0xC2, 0xC3,
169
+ 0xC5, 0xC6, 0xC7,
170
+ 0xC9, 0xCA, 0xCB,
171
+ 0xCD, 0xCE, 0xCF
172
172
  ].freeze
173
173
  def size_of_jpeg(ir)
174
174
  section_marker = "\xFF"
@@ -178,7 +178,7 @@ private
178
178
  offset += 1 until section_marker != ir[offset + 1, 1]
179
179
  raise FormatError, 'EOF in JPEG' if ir[offset, 1].nil?
180
180
 
181
- _marker, code, length = ir[offset, 4].unpack('aan')
181
+ _marker, code, length = ir[offset, 4].unpack('aCn')
182
182
  offset += 4
183
183
 
184
184
  if JPEG_CODE_CHECK.include?(code)
@@ -294,7 +294,7 @@ private
294
294
  end
295
295
 
296
296
  def size_of_pcx(ir)
297
- parts = ir[4, 8].unpack('S4')
297
+ parts = ir[4, 8].unpack('v4')
298
298
  [parts[2] - parts[0] + 1, parts[3] - parts[1] + 1]
299
299
  end
300
300
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_size
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keisuke Minami
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-04 00:00:00.000000000 Z
12
+ date: 2021-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -96,7 +96,7 @@ licenses:
96
96
  metadata:
97
97
  bug_tracker_uri: https://github.com/toy/image_size/issues
98
98
  changelog_uri: https://github.com/toy/image_size/blob/master/CHANGELOG.markdown
99
- documentation_uri: https://www.rubydoc.info/gems/image_size/2.1.1
99
+ documentation_uri: https://www.rubydoc.info/gems/image_size/2.1.2
100
100
  source_code_uri: https://github.com/toy/image_size
101
101
  post_install_message:
102
102
  rdoc_options: []