pixelart 1.3.5 → 1.3.6

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: 43bc0ad17527099593a49e143036c875bf93fc61873d551252a19376490734fd
4
- data.tar.gz: c57fdb4d5241915767f4480a698f3f362d25c53f99805050b8c8dd4c2ca9ec27
3
+ metadata.gz: 92c0d22468eb46c7120b5cdfeeca63f0d4049bdfc055037186e05690e81f3404
4
+ data.tar.gz: 1d5cb926059539d9bce964243a099307e1c03de5be9de7c5285bc76d54acb7cb
5
5
  SHA512:
6
- metadata.gz: 742db57f909288c2a19105244951f676c99723544be749e60544d3576f326f323ec00bcdf0ea9fbeef0e6a6a0d55771f5ad06a7e5fe1a32814b6f509bc472be4
7
- data.tar.gz: 2b7d05f9e4ab9a4f4348b3fb7b7f1f5b36ee884b4db3bae901479c84c4dac0207f67f56ba140319a45bd1704c9af14075ef7dfc3ef20897476dfc5bf242a509c
6
+ metadata.gz: 17a632b18859b6c341e5d80ecc91bdacff31037c3067efcda244d722515e70f8689613dbc205ed0e43300fdb5e5e36da70e079287adf7b4775041ca6ed3d1653
7
+ data.tar.gz: 8fe33b806a59f408ce6666de365e13023175f87314b832cad3f196dc96f4c83aee37013ab554e30e015e2df621047a28091937506b03df1f09deef10773dc5e3
@@ -23,20 +23,27 @@ end
23
23
 
24
24
 
25
25
 
26
-
27
26
  def self.read( path ) ## convenience helper
28
27
  img_inner = ChunkyPNG::Image.from_file( path )
29
- img = new( img_inner.width, img_inner.height, img_inner )
30
- img
28
+ new( img_inner.width, img_inner.height, img_inner )
31
29
  end
32
30
 
33
31
  def self.parse_base64( str )
34
32
  blob = Base64.decode64( str )
35
33
  img_inner = ChunkyPNG::Image.from_blob( blob )
36
- img = new( img_inner.width, img_inner.height, img_inner )
37
- img
34
+ new( img_inner.width, img_inner.height, img_inner )
35
+ end
36
+
37
+ def self.blob( blob )
38
+ img_inner = ChunkyPNG::Image.from_blob( blob )
39
+ new( img_inner.width, img_inner.height, img_inner )
38
40
  end
39
41
 
42
+ class << self
43
+ alias_method :from_blob, :blob
44
+ end
45
+
46
+
40
47
 
41
48
 
42
49
 
@@ -133,7 +140,10 @@ def left( left )
133
140
  end
134
141
 
135
142
 
136
-
143
+ def to_blob
144
+ @img.to_blob
145
+ end
146
+ alias_method :blob, :to_blob
137
147
 
138
148
 
139
149
  #######################
@@ -149,6 +159,11 @@ alias_method :greyscale, :grayscale
149
159
  ######################
150
160
  # flip horizontally on x-axis (top-to-bottom/bottom-to-top)
151
161
  # e.g. pixels on the top will now be pixels on the bottom
162
+ #
163
+ # todo/check: commom use is reverse?
164
+ # e.g. flip_vertically is top-to-bottom!!!
165
+ # use flip_y_axis, flip_x_axis or something else - why? why not?
166
+ # check photoshop and gimp terminology and update later if different - why? why not?
152
167
  def flip_horizontally
153
168
  img = @img.flip_horizontally
154
169
  Image.new( img.width, img.height, img )
@@ -158,6 +173,7 @@ end
158
173
  alias_method :flop, :flip_horizontally
159
174
 
160
175
 
176
+
161
177
  ###
162
178
  # flip vertially on y-axis (right-to-left/left-to-right)
163
179
  # e.g. pixels on the left will now be pixels on the right
@@ -3,7 +3,7 @@ module Pixelart
3
3
 
4
4
  MAJOR = 1
5
5
  MINOR = 3
6
- PATCH = 5
6
+ PATCH = 6
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixelart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocos