fastimage 2.2.5 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastimage/version.rb +3 -1
- data/lib/fastimage.rb +19 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7667683a4bbc8ac16d583fb3ed7c93e6a58a25c19bf8df909ab7dae8d4ef782
|
4
|
+
data.tar.gz: 0baf5dcf6af104d0edd38baf65b7b35c972e6fc4271363d52855071e22b97a82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9261157ade925ba5be4761028b4d70a698f1cc4d54e4ef0fcb7f4b23b6120ae6f9c42516b0dc17f915c423d168a4ef66c805a686ea20e3ca311556ce3e930593
|
7
|
+
data.tar.gz: 2d319a0aa6c4e7c7a3d951b3025d6215ac999bc2efe5d054720dac9c063cb3e2939e35e30660cf360bfae5f88285b91bb8029ec594c64ca1eb9e3e4144fa6b4c
|
data/lib/fastimage/version.rb
CHANGED
data/lib/fastimage.rb
CHANGED
@@ -544,12 +544,9 @@ class FastImage
|
|
544
544
|
case @stream.peek(3).bytes.to_a.last
|
545
545
|
when 0
|
546
546
|
# http://www.ftyps.com/what.html
|
547
|
-
# HEIC is composed of nested "boxes". Each box has a header composed of
|
548
|
-
# - Size (32 bit integer)
|
549
|
-
# - Box type (4 chars)
|
550
|
-
# - Extended size: only if size === 1, the type field is followed by 64 bit integer of extended size
|
551
|
-
# - Payload: Type-dependent
|
552
547
|
case @stream.peek(12)[4..-1]
|
548
|
+
when "ftypavif"
|
549
|
+
:avif
|
553
550
|
when "ftypheic"
|
554
551
|
:heic
|
555
552
|
when "ftypmif1"
|
@@ -584,7 +581,14 @@ class FastImage
|
|
584
581
|
end
|
585
582
|
alias_method :parse_size_for_cur, :parse_size_for_ico
|
586
583
|
|
587
|
-
|
584
|
+
# HEIC/AVIF are a special case of the general ISO_BMFF format, in which all data is encapsulated in typed boxes,
|
585
|
+
# with a mandatory ftyp box that is used to indicate particular file types. Is composed of nested "boxes". Each
|
586
|
+
# box has a header composed of
|
587
|
+
# - Size (32 bit integer)
|
588
|
+
# - Box type (4 chars)
|
589
|
+
# - Extended size: only if size === 1, the type field is followed by 64 bit integer of extended size
|
590
|
+
# - Payload: Type-dependent
|
591
|
+
class IsoBmff # :nodoc:
|
588
592
|
def initialize(stream)
|
589
593
|
@stream = stream
|
590
594
|
end
|
@@ -735,14 +739,19 @@ class FastImage
|
|
735
739
|
end
|
736
740
|
end
|
737
741
|
|
742
|
+
def parse_size_for_avif
|
743
|
+
bmff = IsoBmff.new(@stream)
|
744
|
+
bmff.width_and_height
|
745
|
+
end
|
746
|
+
|
738
747
|
def parse_size_for_heic
|
739
|
-
|
740
|
-
|
748
|
+
bmff = IsoBmff.new(@stream)
|
749
|
+
bmff.width_and_height
|
741
750
|
end
|
742
751
|
|
743
752
|
def parse_size_for_heif
|
744
|
-
|
745
|
-
|
753
|
+
bmff = IsoBmff.new(@stream)
|
754
|
+
bmff.width_and_height
|
746
755
|
end
|
747
756
|
|
748
757
|
class Gif # :nodoc:
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-02-28 00:00:00.000000000 Z
|
@@ -82,7 +82,7 @@ homepage: http://github.com/sdsykes/fastimage
|
|
82
82
|
licenses:
|
83
83
|
- MIT
|
84
84
|
metadata: {}
|
85
|
-
post_install_message:
|
85
|
+
post_install_message:
|
86
86
|
rdoc_options:
|
87
87
|
- "--charset=UTF-8"
|
88
88
|
require_paths:
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubygems_version: 3.1.6
|
102
|
-
signing_key:
|
102
|
+
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: FastImage - Image info fast
|
105
105
|
test_files: []
|