Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 206
- Log:
Initial import of Gullery, an open source photo gallery:
http://nubyonrails.com/pages/gullery
- Author:
- rool
- Date:
- Sun May 20 19:05:59 +0100 2007
- Size:
- 1868 Bytes
1 | MiniMagick |
2 | ========== |
3 | |
4 | A ruby wrapper for ImageMagick command line. |
5 | |
6 | Why? |
7 | --- |
8 | I was using RMagick and loving it, but it was eating up huge amounts of memory. A simple script like this... |
9 | |
10 | Magick::read("image.jpg") do |f| |
11 | f.write("manipulated.jpg") |
12 | end |
13 | |
14 | ...would use over 100 Megs of Ram. On my local machine this wasn't a problem, but on my hosting server the ruby apps would crash because of their 100 Meg memory limit. |
15 | |
16 | Solution! |
17 | --------- |
18 | Using MiniMagick the ruby processes memory remains small (it spawns ImageMagick's command line program mogrify which takes up some memory as well, but is much smaller compared to RMagick) |
19 | |
20 | MiniMagick gives you access to all the commandline options ImageMagick has (Found here http://www.imagemagick.org/script/mogrify.php) |
21 | |
22 | Examples |
23 | -------- |
24 | |
25 | Want to make a thumbnail from a file... |
26 | |
27 | image = MiniMagick::Image.from_file("input.jpg") |
28 | image.resize "100x100" |
29 | image.write("output.jpg") |
30 | |
31 | Want to make a thumbnail from a blob... |
32 | |
33 | image = MiniMagick::Image.from_blob(blob) |
34 | image.resize "100x100" |
35 | image.write("output.jpg") |
36 | |
37 | Need to combine several options? |
38 | |
39 | image = MiniMagick::Image.from_file("input.jpg") |
40 | image.combine_options do |c| |
41 | c.sample "50%" |
42 | c.rotate "-90>" |
43 | end |
44 | image.write("output.jpg") |
45 | |
46 | Want to manipulate an image at its source (You won't have to write it out because the transformations are done on that file) |
47 | |
48 | image = MiniMagick::Image.new("input.jpg") |
49 | image.resize "100x100" |
50 | |
51 | Requirements |
52 | ------------ |
53 | You must have ImageMagick installed. |
54 | |
55 | |
56 | How To Install |
57 | -------------- |
58 | (I've only tested this on OS X and Linux) |
59 | |
60 | I've packaged up MiniMagick as a rails plugin. Just unzip the file to the /vendor/plugins directory of your rails folder and you have access to all the magick. |
61 | |
62 | MiniMagick does NOT require rails though. All the code you need to use MiniMagick is located in the mini_magick/lib/mini_magick.rb file. |
63 | |
64 |