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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47015c365c2eaa3d2fb3178bd8c68b67dcd33428
4
- data.tar.gz: 11440490c24628076aa8f42592640c055126e302
3
+ metadata.gz: 430e9433e3e7d2564aa86a124e41b5285ffabf66
4
+ data.tar.gz: 4477e613b5b98f39f1635cd669d1780e66391f64
5
5
  SHA512:
6
- metadata.gz: e2353ad80438886866c5246d9483ba09000c3729142324e8e650b00d17415076017cfc0260986a647f3da0305d087fe193ff9fb60095cd0d2d82ab590a35fb53
7
- data.tar.gz: ce0fefb4820593aa643a96f3c33d667c2a37c441f132541666cf60c3853866055ef5e1d4e44f7ee32f0d333ac70e095409c0a6835e2a2bb4f4a6b80187eff008
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
@@ -1 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
9
+ rescue LoadError
10
+ # no rspec available
11
+ end
@@ -20,7 +20,7 @@ module Rszr
20
20
  if !ptr.null? && klass
21
21
  #puts " calling #{args.inspect}"
22
22
  klass.send(:finalize, ptr)
23
- ptr = Fiddle::Pointer.new(0)
23
+ @ptr = Fiddle::Pointer.new(0)
24
24
  #else
25
25
  #puts " skipping #{args.inspect}"
26
26
  end
@@ -3,11 +3,20 @@ module Rszr
3
3
  module Lib
4
4
  extend Fiddle::Importer
5
5
 
6
- dlload case RbConfig::CONFIG['arch']
7
- when /darwin/ then 'libImlib2.dylib'
8
- when /mswin/, /cygwin/ then 'imlib2.dll'
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 *'
@@ -1,3 +1,3 @@
1
1
  module Rszr
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-09-28 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler