png_stitcher 0.1.0 → 0.1.1
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 +5 -1
- data/lib/png_stitcher/chunky_png_patch.rb +14 -0
- data/lib/png_stitcher/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ea79d6cc869eb0168a22443f2f3861dfd3bb77181de95943770dc947c8442d3
|
4
|
+
data.tar.gz: 77645e00a8870f126193035d77cdf445adee26e3a890899cbafc1e896f5567cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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
|
data/lib/png_stitcher/version.rb
CHANGED
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.
|
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
|