png_stitcher 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/png_stitcher.rb +7 -5
- data/lib/png_stitcher/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3266d3b97c5deedddccad7ab8de6a8d81442374cc457c5507ee0aa46831ae7a
|
4
|
+
data.tar.gz: 2c0f68f4c425e34b7b5335c18701e714e6f151880cce70477b539a456a7c76c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88390bad0663af9e878e6d9719db3b75d27ba734b88e83ca85fc0cd7639ea1234e1866f526443bd3cf5bcfe84acb9d9d4b0bd57f57b0ab1a3c17c2c7c16d4362
|
7
|
+
data.tar.gz: 14b4dc2c6b6d30af454cd9fef79ee0a5fb1ddda670a79f0f268a3116b1a64395d0c8b65fc69fd01ec78aeca0e1397824c3969d58ebdcd76870b0d0f02875ef18
|
data/lib/png_stitcher.rb
CHANGED
@@ -11,13 +11,15 @@ module PngStitcher
|
|
11
11
|
streams = []
|
12
12
|
height = 0
|
13
13
|
width = nil
|
14
|
-
|
14
|
+
palette_chunk = nil
|
15
|
+
transparency_chunk = nil
|
15
16
|
physical_chunk = nil
|
16
17
|
|
17
18
|
blobs.each do |blob|
|
18
19
|
stream = ChunkyPNG::Datastream.from_blob(blob)
|
19
20
|
physical_chunk ||= stream.physical_chunk
|
20
|
-
|
21
|
+
palette_chunk ||= stream.palette_chunk
|
22
|
+
transparency_chunk ||= stream.transparency_chunk
|
21
23
|
header = stream.header_chunk
|
22
24
|
width ||= header.width
|
23
25
|
height += header.height
|
@@ -26,7 +28,7 @@ module PngStitcher
|
|
26
28
|
raise ArgumentError, "Pixel Depth must be 1 bit per pixel" unless header.depth == 1
|
27
29
|
raise ArgumentError, "Interlacing must be disabled" unless header.interlace == ChunkyPNG::INTERLACING_NONE
|
28
30
|
raise ArgumentError, "All of the images must be the same width" unless header.width == width
|
29
|
-
raise ArgumentError, "All of the images must have the same palette" unless
|
31
|
+
raise ArgumentError, "All of the images must have the same palette" unless palette_chunk.content == stream.palette_chunk.content && transparency_chunk&.content == stream.transparency_chunk&.content
|
30
32
|
|
31
33
|
streams << stream
|
32
34
|
end
|
@@ -40,8 +42,8 @@ module PngStitcher
|
|
40
42
|
color: ChunkyPNG::COLOR_INDEXED,
|
41
43
|
depth: 1,
|
42
44
|
interlace: 0)
|
43
|
-
stream.palette_chunk =
|
44
|
-
stream.transparency_chunk =
|
45
|
+
stream.palette_chunk = palette_chunk
|
46
|
+
stream.transparency_chunk = transparency_chunk
|
45
47
|
stream.physical_chunk = physical_chunk
|
46
48
|
|
47
49
|
stream.data_chunks = ChunkyPNG::Chunk::ImageData.split_in_chunks(data)
|
data/lib/png_stitcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: png_stitcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Lail
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chunky_png
|
@@ -195,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
|
-
|
199
|
-
rubygems_version: 2.7.3
|
198
|
+
rubygems_version: 3.0.3
|
200
199
|
signing_key:
|
201
200
|
specification_version: 4
|
202
201
|
summary: Stitches an array of PNG blogs into one
|