catpix_mini 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbe7bb291ed03d1f3f945fe22fd96230016be3e1
4
- data.tar.gz: 89b52d847d8e76dfa0c8aa69eabcfbb3fbfd7ace
3
+ metadata.gz: 0bc8d5334f7b77bb8f0c68953cf19c62741003ca
4
+ data.tar.gz: ed5aeffb958c1db66fc3dbfe2d622c5d524be086
5
5
  SHA512:
6
- metadata.gz: 259af61caf5768dd2eeea81ca932e840233206275036d36b8fd8afafaf0af569664c2f0e1713e584dacab118881350c4ddc07a6fdf70148df57544e00b1e7c44
7
- data.tar.gz: 0051a1e22e34b494382ef415947e4f74e2edc30eb3669ddc51fb6872619773c30c5e9151eab056a04a020535b69ab9a93d5a06fe56df818810e7541bb76ead5a
6
+ metadata.gz: 34baa5e8b5f8a2adc24b208120ea7c42c5861bdef85f071947b640524556496e66e2c09def65bd430ffb4895eadad47cfcf63ac7d9702e9911ce02dcebbd3048
7
+ data.tar.gz: a72af0d8cbef4a902e067af1b7588c3e60605047744784e4fb0ba9778726b067bcef5197b26df8a708fe742715a882cdeb9a03614524d7d93e84e8f86896532b
@@ -0,0 +1,5 @@
1
+ ## 0.1.0
2
+ The beginning of time
3
+
4
+ ## 0.1.1
5
+ - Fixed crash if displaying full width image when catpix_mini being included by another gem.
data/README.md CHANGED
@@ -2,18 +2,26 @@
2
2
 
3
3
  Renders images in the terminal.
4
4
 
5
- ## Why not a fork but clone
5
+ This project is a "port" from [pazdera's catpix repo](https://github.com/pazdera/catpix).
6
6
 
7
- This project is a "port" from [pazdera's catpix repo](https://github.com/pazdera/catpix).
8
- The original project is based on RMagick while this one is based on MiniMagick. I was spending
9
- time finding solutions with MiniMagick but could not find any hence I decided to port from the
10
- original.
7
+ The original project is based on RMagick while this one is compatible with MiniMagick. I made this project in hope that MiniMagick would speed up the original gem and some other mini-magick fans will be able to use this awesome feature in their minimagick projects.
11
8
 
9
+ I would probably switch over to rmagick for serious projects in the future. I just did not want to invest effort in switching from mini-magick to rmagick in my main app so I think this 1 day work is pretty useful.
10
+
11
+ ## Example
12
+
13
+ $ catpix_mini pokemon.gif
14
+
12
15
  ![Pokemon](http://radek.io/assets/images/posts/catpix/pokemon.png)
13
16
 
14
- ## More examples
17
+ ## More examples and options
18
+
19
+ $ catpix_mini panda.png -c xy
20
+ $ catpix_mini trophy.png -w 0.5 -h 0.5
21
+ $ catpix_mini tux.png -c xy -r high # enforce high resolution
15
22
 
16
- For more examples and APIs please check out [pazdera's catpix repo](https://github.com/pazdera/catpix). They should be very similar at this point except that the binary name is changed from `catpix` to `catpix_mini`.
23
+ For more examples and APIs please check out [pazdera's catpix repo](https://github.com/pazdera/catpix).
24
+ They should be very similar at this point except that the binary name is changed from `catpix` to `catpix_mini`.
17
25
 
18
26
  ## Performances
19
27
 
@@ -25,7 +33,7 @@ has upper advantage when rendering large image while catpix is slightly faster f
25
33
  time catpix ./img/benchmark.jpg
26
34
  48.25s user 0.56s system 87% cpu 55.578 total
27
35
 
28
- catpix_mini ./img/benchmark.jpg
36
+ time catpix_mini ./img/benchmark.jpg
29
37
  42.26s user 0.76s system 83% cpu 51.647 total
30
38
 
31
39
 
@@ -36,11 +44,16 @@ more proper tests and let me know your results.
36
44
 
37
45
  ## Quality
38
46
 
39
- RMagick return pixels colours in 16bits by default while MiniMagick is only 8 bits therefor the
47
+ RMagick return pixels' colours in `16-bit` by default while MiniMagick colour is only `8-bit` therefor the
40
48
  quality at high-res looks slightly better in catpix compared to catpix-mini.
41
49
 
42
50
  Only slightly because the quality printed out to terminal is not too insanely detailed to begin with.
43
51
 
52
+ ## Transparency
53
+
54
+ Due to the performance advantage is not too impressive, I have not invested time to do pixel reading per pixel to detect alpha channel for the image. Therefor transparent images printed out by catpix_mini will be in white-background.
55
+
56
+ Another disadvantage of mini-magick.
44
57
 
45
58
  ## About Me
46
59
 
Binary file
@@ -128,7 +128,7 @@ module CatpixMini
128
128
  #############################################################################
129
129
 
130
130
  def self.prep_vert_margin(size, colour)
131
- tw = get_screen_size
131
+ tw, th = get_screen_size
132
132
 
133
133
  buffer = ""
134
134
  if high_res?
@@ -3,5 +3,5 @@
3
3
 
4
4
  module CatpixMini
5
5
  # Version of the gem
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catpix_mini
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
  - Radek Pazdera
@@ -143,6 +143,7 @@ files:
143
143
  - Rakefile
144
144
  - bin/catpix_mini
145
145
  - catpix_mini.gemspec
146
+ - img/benchmark.jpg
146
147
  - lib/catpix_mini.rb
147
148
  - lib/catpix_mini/private.rb
148
149
  - lib/catpix_mini/version.rb