libpng-ruby 0.5.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/ext/png/extconf.rb +13 -0
- data/ext/png/png.c +1002 -340
- data/lib/png/version.rb +1 -1
- data/libpng-ruby.gemspec +5 -4
- metadata +19 -21
- data/bin/pnginfo +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a7a14159672b5baccc3dc51269db0f83b942d57062d970d1b4870cdf560f3a8
|
4
|
+
data.tar.gz: e923bf2f1a1e4fb42b51808949baee393cbbb8e7f3dc51b61b69f9927ef4dfcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b89324c661cba887d6de37719d8131236f6801e3ebe266ee029cbd19e58ea1e05a2fa8f995e716b4dc347055e318bc68bf3829e69f3c64a8ecf3cc4a54cb4b15
|
7
|
+
data.tar.gz: 2d236ed145212e145d7eba5a02d8fc5ae24da0b998a61054a5ad314dff06d050b25edf1a5ee75c9478e879ccb9b647a5526a13e9148aa3f30475fa69b1eaa78f
|
data/README.md
CHANGED
@@ -15,6 +15,10 @@ Or install it yourself as:
|
|
15
15
|
|
16
16
|
$ gem install libpng-ruby
|
17
17
|
|
18
|
+
If you need to specify the libpng path, use the following options:
|
19
|
+
|
20
|
+
$ gem install libpng-ruby -- --with-png-include ~/env/opts/include --with-png-lib ~/env/opts/lib
|
21
|
+
|
18
22
|
## Usage
|
19
23
|
|
20
24
|
### decode sample
|
@@ -22,7 +26,7 @@ Or install it yourself as:
|
|
22
26
|
```ruby
|
23
27
|
require 'png'
|
24
28
|
|
25
|
-
dec = PNG::Decoder.new(:
|
29
|
+
dec = PNG::Decoder.new(:pixel_format => :BGR)
|
26
30
|
|
27
31
|
p dec.read_header(IO.binread("test.png"))
|
28
32
|
|
@@ -55,7 +59,7 @@ IO.binwrite("test.png", enc << IO.binread("test.raw"))
|
|
55
59
|
#### encode options
|
56
60
|
| option | value type | description |
|
57
61
|
|---|---|---|
|
58
|
-
| :
|
62
|
+
| :pixel_format | String or Symbol | input pixel format |
|
59
63
|
| :interlace | Boolean | use interlace mode |
|
60
64
|
| :compression | Integer or String or Symbol | compression level |
|
61
65
|
| :text | Hash | text information |
|
data/ext/png/extconf.rb
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
require 'mkmf'
|
2
|
+
require 'optparse'
|
3
|
+
|
4
|
+
OptionParser.new { |opt|
|
5
|
+
opt.on('--with-png-include=PATH', String) { |path|
|
6
|
+
$CFLAGS << " -I#{path}"
|
7
|
+
}
|
8
|
+
|
9
|
+
opt.on('--with-png-lib=PATH', String) { |path|
|
10
|
+
$LDFLAGS << " -L#{path}"
|
11
|
+
}
|
12
|
+
|
13
|
+
opt.parse!(ARGV)
|
14
|
+
}
|
2
15
|
|
3
16
|
have_library( "png16")
|
4
17
|
have_header( "png.h")
|