sdsykes-fastimage_resize 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +58 -0
- data/VERSION.yml +3 -3
- metadata +2 -2
data/README.textile
CHANGED
@@ -2,6 +2,12 @@ h1. FastImage Resize
|
|
2
2
|
|
3
3
|
h4. FastImage Resize is an extremely light solution for resizing images in ruby by using libgd
|
4
4
|
|
5
|
+
FastImage Resize will resize gifs, jpegs, and png files.
|
6
|
+
|
7
|
+
It uses resampling to get good looking results.
|
8
|
+
|
9
|
+
And it doesn't rely on installing external heavy libraries such as RMagick (which relies on ImageMagick or GraphicsMagick) or ImageScience (which relies on FreeImage).
|
10
|
+
|
5
11
|
h2. Examples
|
6
12
|
|
7
13
|
<pre>
|
@@ -13,6 +19,45 @@ h2. Examples
|
|
13
19
|
</pre>
|
14
20
|
</code>
|
15
21
|
|
22
|
+
The file my.gif is created locally, containing the resized image.
|
23
|
+
|
24
|
+
h2. Installation
|
25
|
+
|
26
|
+
First check the requirements section below.
|
27
|
+
|
28
|
+
h4. Gem
|
29
|
+
|
30
|
+
<pre>
|
31
|
+
<code>
|
32
|
+
sudo gem install sdsykes-fastimage_resize -s http://gems.github.com
|
33
|
+
</pre>
|
34
|
+
</code>
|
35
|
+
|
36
|
+
h4. Rails
|
37
|
+
|
38
|
+
Install the gem as above, and configure it in your environment.rb file as below:
|
39
|
+
<pre>
|
40
|
+
<code>
|
41
|
+
...
|
42
|
+
Rails::Initializer.run do |config|
|
43
|
+
...
|
44
|
+
config.gem "sdsykes-fastimage_resize", :lib=>"fastimage_resize"
|
45
|
+
...
|
46
|
+
end
|
47
|
+
...
|
48
|
+
</code>
|
49
|
+
</pre>
|
50
|
+
|
51
|
+
You may also need this in your environment.rb so that the rails process puts the compiled C code in a place it can access:
|
52
|
+
|
53
|
+
<pre>
|
54
|
+
<code>
|
55
|
+
ENV['INLINEDIR'] = RAILS_ROOT + "/tmp" # for RubyInline
|
56
|
+
</code>
|
57
|
+
</pre>
|
58
|
+
|
59
|
+
Then you're off - just use FastImage.resize() in your code as in the examples.
|
60
|
+
|
16
61
|
h2. Requirements
|
17
62
|
|
18
63
|
* RubyInline
|
@@ -37,6 +82,19 @@ See "http://www.libgd.org/":http://www.libgd.org/
|
|
37
82
|
|
38
83
|
Libgd is commonly available on most unix platforms, including OSX.
|
39
84
|
|
85
|
+
h2. Documentation
|
86
|
+
|
87
|
+
"http://rdoc.info/projects/sdsykes/fastimage_resize":http://rdoc.info/projects/sdsykes/fastimage_resize
|
88
|
+
|
89
|
+
h2. Caveats
|
90
|
+
|
91
|
+
Because of the way that libgd works, gif files that have transparency may not always come through with the transparency perfectly retained.
|
92
|
+
|
93
|
+
|
94
|
+
h2. Tests
|
95
|
+
|
96
|
+
You'll need to 'sudo gem install fakeweb' to be able to run the tests
|
97
|
+
|
40
98
|
h2. References
|
41
99
|
|
42
100
|
* "http://blog.new-bamboo.co.uk/2007/12/3/super-f-simple-resizing":http://blog.new-bamboo.co.uk/2007/12/3/super-f-simple-resizing
|
data/VERSION.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
---
|
2
|
-
:patch:
|
3
|
-
:major:
|
4
|
-
:minor:
|
2
|
+
:patch: 0
|
3
|
+
:major: 1
|
4
|
+
:minor: 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdsykes-fastimage_resize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|