png_stitcher 0.1.0 → 0.1.1

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: ba2f50303712bbb5f03427d6bd5013086aec3312f5841b2c16ffd99a8c6618f2
4
- data.tar.gz: bed853c335b5b058404ecb8ba342ed4e746cd7eb8283fa45c3bfdd5d2aef91fd
3
+ metadata.gz: 3ea79d6cc869eb0168a22443f2f3861dfd3bb77181de95943770dc947c8442d3
4
+ data.tar.gz: 77645e00a8870f126193035d77cdf445adee26e3a890899cbafc1e896f5567cd
5
5
  SHA512:
6
- metadata.gz: 47163e007504c3ee3a466d0b5e2ed5a71369fddb23ab99a9a683f46a50cff086cce06e98a12052e9d33374bd564825fd6eebee0f06e5864feaab281e6cf43789
7
- data.tar.gz: 682c0259a3d871a786cda7e4696802137558a177c3c462db5d4a6e786133acae2eb2b1e3a5ca9e524d649d2491a5018268bbbe0b1e72fa1c009dbe61d12627a5
6
+ metadata.gz: b969aa9bf03ca4a44c901c5f6b48d8eba7a4eb40793132ed6a53bcb920ed0abe4f46907e718589281f1c455aced3d24a5fd931a342db062f1c5e5b4e425eeb8e
7
+ data.tar.gz: 32e5786e898a70b6f8573e3fd746b1e30ea35a7336e74ce30577b1d61265a6c9634b698527a6403a934a759cd68bf83fc680c2980899e2b7c85eb5a230d5c31e
data/lib/png_stitcher.rb CHANGED
@@ -1,6 +1,7 @@
1
+ require "chunky_png"
1
2
  require "png_stitcher/version"
2
3
  require "png_stitcher/png_stitcher"
3
- require "chunky_png"
4
+ require "png_stitcher/chunky_png_patch"
4
5
 
5
6
  module PngStitcher
6
7
  class << self
@@ -11,9 +12,11 @@ module PngStitcher
11
12
  height = 0
12
13
  width = nil
13
14
  palette = nil
15
+ physical_chunk = nil
14
16
 
15
17
  blobs.each do |blob|
16
18
  stream = ChunkyPNG::Datastream.from_blob(blob)
19
+ physical_chunk ||= stream.physical_chunk
17
20
  palette ||= ChunkyPNG::Palette.from_chunks(stream.palette_chunk, stream.transparency_chunk)
18
21
  header = stream.header_chunk
19
22
  width ||= header.width
@@ -39,6 +42,7 @@ module PngStitcher
39
42
  interlace: 0)
40
43
  stream.palette_chunk = palette.to_plte_chunk
41
44
  stream.transparency_chunk = palette.to_trns_chunk unless palette.opaque?
45
+ stream.physical_chunk = physical_chunk
42
46
 
43
47
  stream.data_chunks = ChunkyPNG::Chunk::ImageData.split_in_chunks(data)
44
48
  stream.end_chunk = ChunkyPNG::Chunk::End.new
@@ -0,0 +1,14 @@
1
+ require "chunky_png/chunk"
2
+
3
+ module ChunkyPNG
4
+ module Chunk
5
+ class Physical < Base
6
+
7
+ def ==(other)
8
+ other.is_a?(ChunkyPNG::Chunk::Physical) && self.ppux == other.ppux &&
9
+ self.ppuy == other.ppuy && self.unit == other.unit
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module PngStitcher
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: png_stitcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
@@ -172,6 +172,7 @@ files:
172
172
  - ext/png_stitcher/png_stitcher.c
173
173
  - ext/png_stitcher/png_stitcher.h
174
174
  - lib/png_stitcher.rb
175
+ - lib/png_stitcher/chunky_png_patch.rb
175
176
  - lib/png_stitcher/version.rb
176
177
  - png_stitcher.gemspec
177
178
  homepage: https://github.com/cph/png_stitcher