rszr 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/Rakefile +10 -0
- data/lib/rszr/handle.rb +1 -1
- data/lib/rszr/lib.rb +13 -4
- data/lib/rszr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 430e9433e3e7d2564aa86a124e41b5285ffabf66
|
4
|
+
data.tar.gz: 4477e613b5b98f39f1635cd669d1780e66391f64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ff2d67706cc334f496af3b522f9071809d774aaac4883bd6a948f27b1f0dc44d11b63c42834d9f2885d27a2d83f1c639e7a372da281b2b98482aee7c87360da
|
7
|
+
data.tar.gz: 3fdf4147d6a4bcb6c99e6feefc017bdcca3b63e1b4b0dc28e90661acdc2d6e9f955669f85426ba590087195cc35332f14d4f67f73be052909ae66281885b55c0
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/rszr.svg)](http://badge.fury.io/rb/rszr) [![Build Status](https://travis-ci.org/mtgrosser/rszr.svg)](https://travis-ci.org/mtgrosser/rszr)
|
1
2
|
# Rszr
|
2
3
|
|
3
4
|
Rszr is a fast image resizer.
|
@@ -27,11 +28,11 @@ brew install imlib2
|
|
27
28
|
Using your favourite package manager:
|
28
29
|
|
29
30
|
```bash
|
30
|
-
yum install imlib2
|
31
|
+
yum install imlib2 imlib2-devel
|
31
32
|
```
|
32
33
|
|
33
34
|
```bash
|
34
|
-
apt-get install libimlib2
|
35
|
+
apt-get install libimlib2 libimlib2-dev
|
35
36
|
```
|
36
37
|
|
37
38
|
## Usage
|
@@ -40,6 +41,8 @@ apt-get install libimlib2
|
|
40
41
|
# bounding box 400x300
|
41
42
|
image = Rszr::Image.load('image.jpg')
|
42
43
|
image.resize(400, 300)
|
44
|
+
|
45
|
+
# save it
|
43
46
|
image.save('resized.jpg')
|
44
47
|
|
45
48
|
# auto height
|
data/Rakefile
CHANGED
data/lib/rszr/handle.rb
CHANGED
data/lib/rszr/lib.rb
CHANGED
@@ -3,11 +3,20 @@ module Rszr
|
|
3
3
|
module Lib
|
4
4
|
extend Fiddle::Importer
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
library, message = case RbConfig::CONFIG['arch']
|
7
|
+
when /darwin/ then ['libImlib2.dylib', 'brew install imlib2']
|
8
|
+
when /mswin/, /cygwin/ then ['imlib2.dll', nil]
|
9
9
|
else
|
10
|
-
'libImlib2.so'
|
10
|
+
['libImlib2.so', "yum install imlib2 imlib2-devel\napt-get install libimlib2 libimlib2-dev"]
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
dlload library
|
15
|
+
rescue Fiddle::DLError => e
|
16
|
+
print "\n The Imlib2 library could not be loaded. "
|
17
|
+
puts "You can install it using\n\n #{message}\n" if message
|
18
|
+
puts ''
|
19
|
+
raise e
|
11
20
|
end
|
12
21
|
|
13
22
|
typealias 'Imlib_Image', 'void *'
|
data/lib/rszr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rszr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|