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 +4 -4
- data/CHANGELOG.markdown +4 -0
- data/README.markdown +2 -2
- data/image_size.gemspec +1 -1
- data/lib/image_size.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5bf43db03f3e3f62465528a32d65b65592240db8756ef759f17b6b2d0c1f14
|
4
|
+
data.tar.gz: 4b5cfe6468ba3208528c971ce0873760688dd6a59f170d20fe5dc2934a4ca5ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
2
|
-
[![Build Status](https://
|
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.
|
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 =
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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('
|
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('
|
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.
|
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-
|
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.
|
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: []
|