fastimage 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +1 -0
- data/lib/fastimage.rb +25 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72e83c6f6d442c29071e060cca8a8b0a0a17024a7871cd19a64b83f77e0c0ced
|
4
|
+
data.tar.gz: 56d0f5f86e11f1a8922cdf5bbe292fef2753f5637df402fd7532ef21d8393537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 002eb40a04b2ce79f8cdc34ee2fdc0d70fe35ff964d380096302682756a17e4b22f8275e335822f5229080aada2ca8d5d17603607cb0cf6479b61ac6d4dd64ef
|
7
|
+
data.tar.gz: 17c8efefdc90fae00178d045bb0670e2914f9f19eabdb0be983c49ffb573b752672f02678e38b1395129d7f55ffc42905fa1cbeb9017445ffa295db6cc4fe119
|
data/README.textile
CHANGED
@@ -156,6 +156,7 @@ h2. FastImage in other languages
|
|
156
156
|
* "Node.js by ShogunPanda":https://github.com/ShogunPanda/fastimage
|
157
157
|
* "Objective C by kylehickinson":https://github.com/kylehickinson/FastImage
|
158
158
|
* "Android by qstumn":https://github.com/qstumn/FastImageSize
|
159
|
+
* "Flutter by ky1vstar":https://github.com/ky1vstar/fastimage.dart
|
159
160
|
|
160
161
|
h2. Licence
|
161
162
|
|
data/lib/fastimage.rb
CHANGED
@@ -578,38 +578,45 @@ class FastImage
|
|
578
578
|
# Checks if a delay between frames exists and if it does, then the GIFs is
|
579
579
|
# animated
|
580
580
|
def animated?
|
581
|
-
|
581
|
+
frames = 0
|
582
582
|
|
583
|
-
|
583
|
+
# "GIF" + version (3) + width (2) + height (2)
|
584
|
+
@stream.skip(10)
|
584
585
|
|
585
|
-
|
586
|
-
|
587
|
-
#
|
588
|
-
if fields & 0x80
|
586
|
+
# fields (1) + bg color (1) + pixel ratio (1)
|
587
|
+
fields = @stream.read(3).unpack("CCC")[0]
|
588
|
+
if fields & 0x80 # Global Color Table
|
589
589
|
# 2 * (depth + 1) colors, each occupying 3 bytes (RGB)
|
590
590
|
@stream.skip(3 * 2 ** ((fields & 0x7) + 1))
|
591
591
|
end
|
592
592
|
|
593
593
|
loop do
|
594
594
|
block_type = @stream.read(1).unpack("C")[0]
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
595
|
+
|
596
|
+
if block_type == 0x21 # Graphic Control Extension
|
597
|
+
# extension type (1) + size (1)
|
598
|
+
size = @stream.read(2).unpack("CC")[1]
|
599
|
+
@stream.skip(size)
|
600
|
+
skip_sub_blocks
|
601
|
+
elsif block_type == 0x2C # Image Descriptor
|
602
|
+
frames += 1
|
603
|
+
return true if frames > 1
|
604
|
+
|
605
|
+
# left position (2) + top position (2) + width (2) + height (2) + fields (1)
|
606
|
+
fields = @stream.read(9).unpack("SSSSC")[4]
|
607
|
+
if fields & 0x80 != 0 # Local Color Table
|
608
|
+
# 2 * (depth + 1) colors, each occupying 3 bytes (RGB)
|
609
|
+
@stream.skip(3 * 2 ** ((fields & 0x7) + 1))
|
605
610
|
end
|
611
|
+
|
612
|
+
@stream.skip(1) # LZW min code size (1)
|
606
613
|
skip_sub_blocks
|
607
614
|
else
|
608
|
-
|
615
|
+
break # unrecognized block
|
609
616
|
end
|
610
617
|
end
|
611
618
|
|
612
|
-
|
619
|
+
false
|
613
620
|
end
|
614
621
|
|
615
622
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastimage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.0.
|
100
|
+
rubygems_version: 3.0.3
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: FastImage - Image info fast
|