png_stitcher 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ea79d6cc869eb0168a22443f2f3861dfd3bb77181de95943770dc947c8442d3
4
- data.tar.gz: 77645e00a8870f126193035d77cdf445adee26e3a890899cbafc1e896f5567cd
3
+ metadata.gz: c3266d3b97c5deedddccad7ab8de6a8d81442374cc457c5507ee0aa46831ae7a
4
+ data.tar.gz: 2c0f68f4c425e34b7b5335c18701e714e6f151880cce70477b539a456a7c76c5
5
5
  SHA512:
6
- metadata.gz: b969aa9bf03ca4a44c901c5f6b48d8eba7a4eb40793132ed6a53bcb920ed0abe4f46907e718589281f1c455aced3d24a5fd931a342db062f1c5e5b4e425eeb8e
7
- data.tar.gz: 32e5786e898a70b6f8573e3fd746b1e30ea35a7336e74ce30577b1d61265a6c9634b698527a6403a934a759cd68bf83fc680c2980899e2b7c85eb5a230d5c31e
6
+ metadata.gz: 88390bad0663af9e878e6d9719db3b75d27ba734b88e83ca85fc0cd7639ea1234e1866f526443bd3cf5bcfe84acb9d9d4b0bd57f57b0ab1a3c17c2c7c16d4362
7
+ data.tar.gz: 14b4dc2c6b6d30af454cd9fef79ee0a5fb1ddda670a79f0f268a3116b1a64395d0c8b65fc69fd01ec78aeca0e1397824c3969d58ebdcd76870b0d0f02875ef18
@@ -11,13 +11,15 @@ module PngStitcher
11
11
  streams = []
12
12
  height = 0
13
13
  width = nil
14
- palette = nil
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
- palette ||= ChunkyPNG::Palette.from_chunks(stream.palette_chunk, stream.transparency_chunk)
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 palette == ChunkyPNG::Palette.from_chunks(stream.palette_chunk, stream.transparency_chunk)
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 = palette.to_plte_chunk
44
- stream.transparency_chunk = palette.to_trns_chunk unless palette.opaque?
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)
@@ -1,3 +1,3 @@
1
1
  module PngStitcher
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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: 2018-09-20 00:00:00.000000000 Z
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
- rubyforge_project:
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