miso 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/LICENSE +20 -0
  2. data/README +55 -0
  3. data/Rakefile +54 -0
  4. data/TODO +2 -0
  5. data/VERSION +1 -0
  6. data/html/classes/Miso.html +133 -0
  7. data/html/classes/Miso/Factory.html +278 -0
  8. data/html/classes/Miso/Image.html +394 -0
  9. data/html/classes/Miso/Processor.html +379 -0
  10. data/html/classes/Miso/Processor/CoreImage.html +246 -0
  11. data/html/classes/Miso/Processor/ImageMagick.html +345 -0
  12. data/html/classes/Miso/Processor/NotImplementedError.html +111 -0
  13. data/html/created.rid +1 -0
  14. data/html/files/LICENSE.html +133 -0
  15. data/html/files/README.html +156 -0
  16. data/html/files/lib/miso/factory_rb.html +101 -0
  17. data/html/files/lib/miso/image_rb.html +101 -0
  18. data/html/files/lib/miso/processor/core_image_rb.html +108 -0
  19. data/html/files/lib/miso/processor/image_magick_rb.html +110 -0
  20. data/html/files/lib/miso/processor_rb.html +101 -0
  21. data/html/files/lib/miso_rb.html +101 -0
  22. data/html/fr_class_index.html +33 -0
  23. data/html/fr_file_index.html +34 -0
  24. data/html/fr_method_index.html +62 -0
  25. data/html/index.html +24 -0
  26. data/html/rdoc-style.css +208 -0
  27. data/lib/miso.rb +5 -0
  28. data/lib/miso/factory.rb +53 -0
  29. data/lib/miso/image.rb +51 -0
  30. data/lib/miso/processor.rb +61 -0
  31. data/lib/miso/processor/core_image.rb +27 -0
  32. data/lib/miso/processor/image_magick.rb +59 -0
  33. data/spec/api/factory_spec.rb +31 -0
  34. data/spec/api/image_spec.rb +115 -0
  35. data/spec/api/processor/image_magick_spec.rb +22 -0
  36. data/spec/api/processor_spec.rb +41 -0
  37. data/spec/fixtures/120x100.png +0 -0
  38. data/spec/start.rb +30 -0
  39. metadata +97 -0
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Miso::Processor::NotImplementedError</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Miso::Processor::NotImplementedError</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/miso/processor_rb.html">
59
+ lib/miso/processor.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ StandardError
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+
86
+ </div>
87
+
88
+
89
+ <!-- if includes -->
90
+
91
+ <div id="section">
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <!-- if method_list -->
101
+
102
+
103
+ </div>
104
+
105
+
106
+ <div id="validator-badges">
107
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
+ </div>
109
+
110
+ </body>
111
+ </html>
data/html/created.rid ADDED
@@ -0,0 +1 @@
1
+ Tue, 20 Oct 2009 17:19:55 +0200
@@ -0,0 +1,133 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: LICENSE</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>LICENSE</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>LICENSE
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Oct 20 14:18:36 +0200 2009</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ Copyright (c) 2009
74
+ </p>
75
+ <pre>
76
+ Manfred Stienstra, Fingertips &lt;manfred@fngtps.com&gt;
77
+ Eloy Duran, Fingertips &lt;eloy@fngtps.com&gt;
78
+ </pre>
79
+ <p>
80
+ Permission is hereby granted, free of charge, to any person obtaining a
81
+ copy of this software and associated documentation files (the
82
+ &quot;Software&quot;), to deal in the Software without restriction,
83
+ including without limitation the rights to use, copy, modify, merge,
84
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
85
+ permit persons to whom the Software is furnished to do so, subject to the
86
+ following conditions:
87
+ </p>
88
+ <p>
89
+ The above copyright notice and this permission notice shall be included in
90
+ all copies or substantial portions of the Software.
91
+ </p>
92
+ <p>
93
+ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
94
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
95
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
96
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
97
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
98
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
99
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
100
+ </p>
101
+
102
+ </div>
103
+
104
+
105
+ </div>
106
+
107
+
108
+ </div>
109
+
110
+
111
+ <!-- if includes -->
112
+
113
+ <div id="section">
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ <!-- if method_list -->
123
+
124
+
125
+ </div>
126
+
127
+
128
+ <div id="validator-badges">
129
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
130
+ </div>
131
+
132
+ </body>
133
+ </html>
@@ -0,0 +1,156 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: README</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>README</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>README
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Oct 20 17:19:38 +0200 2009</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ (&#8230;) <a href="../classes/Miso.html">Miso</a>
74
+ </p>
75
+ <p>
76
+ <a href="../classes/Miso.html">Miso</a> is a unified API for simple image
77
+ operations commonly used on the web. It provides backends for often used
78
+ graphic libraries, but it&#8216;s also pretty easy to plug in your own
79
+ backend.
80
+ </p>
81
+ <p>
82
+ A unified API is helpful when you run your code on a number of different
83
+ boxes and architectures. For instance, you could develop your web
84
+ application on your Mac with the Core Image backend [1] and deploy to your
85
+ Linux server with an ImageMagick backend. You could even have the API talk
86
+ to your custom distributed image processing backend.
87
+ </p>
88
+ <p>
89
+ <a href="../classes/Miso.html">Miso</a> can be used in three different
90
+ ways, each useful in different situations.
91
+ </p>
92
+ <pre>
93
+ 1. For the quick crop
94
+
95
+ Miso::Image.crop('input.jpg', 'output.jpg', 120, 100)
96
+
97
+ 2. For the elaborate business logic
98
+
99
+ @image = Miso::Image.new('input.jpg')
100
+ @image.crop(120, 100) if options[:crop]
101
+ @image.fit(120, 100) if options[:fit]
102
+ @image.write('output.jpg')
103
+
104
+ 3. As an option
105
+
106
+ class Attachment
107
+ has_variant :avatar,
108
+ :processor =&gt; Miso::Image.factory.crop(120, 100).fit(60, 40)
109
+ end
110
+
111
+ Which works like this;
112
+
113
+ factory = Miso::Image.factory.crop(123, 456)
114
+ factory.apply('input.jpg', 'output.jpg')
115
+ </pre>
116
+ <p>
117
+ Have fun with <a href="../classes/Miso.html">Miso</a>!
118
+ </p>
119
+ <dl>
120
+ <dt>1</dt><dd>Note how that means you will never have to install ImageMagick again (;
121
+
122
+ </dd>
123
+ </dl>
124
+
125
+ </div>
126
+
127
+
128
+ </div>
129
+
130
+
131
+ </div>
132
+
133
+
134
+ <!-- if includes -->
135
+
136
+ <div id="section">
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <!-- if method_list -->
146
+
147
+
148
+ </div>
149
+
150
+
151
+ <div id="validator-badges">
152
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
153
+ </div>
154
+
155
+ </body>
156
+ </html>
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: factory.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>factory.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/miso/factory.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Oct 20 16:55:39 +0200 2009</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>