miso 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +20 -0
- data/README +55 -0
- data/Rakefile +54 -0
- data/TODO +2 -0
- data/VERSION +1 -0
- data/html/classes/Miso.html +133 -0
- data/html/classes/Miso/Factory.html +278 -0
- data/html/classes/Miso/Image.html +394 -0
- data/html/classes/Miso/Processor.html +379 -0
- data/html/classes/Miso/Processor/CoreImage.html +246 -0
- data/html/classes/Miso/Processor/ImageMagick.html +345 -0
- data/html/classes/Miso/Processor/NotImplementedError.html +111 -0
- data/html/created.rid +1 -0
- data/html/files/LICENSE.html +133 -0
- data/html/files/README.html +156 -0
- data/html/files/lib/miso/factory_rb.html +101 -0
- data/html/files/lib/miso/image_rb.html +101 -0
- data/html/files/lib/miso/processor/core_image_rb.html +108 -0
- data/html/files/lib/miso/processor/image_magick_rb.html +110 -0
- data/html/files/lib/miso/processor_rb.html +101 -0
- data/html/files/lib/miso_rb.html +101 -0
- data/html/fr_class_index.html +33 -0
- data/html/fr_file_index.html +34 -0
- data/html/fr_method_index.html +62 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/lib/miso.rb +5 -0
- data/lib/miso/factory.rb +53 -0
- data/lib/miso/image.rb +51 -0
- data/lib/miso/processor.rb +61 -0
- data/lib/miso/processor/core_image.rb +27 -0
- data/lib/miso/processor/image_magick.rb +59 -0
- data/spec/api/factory_spec.rb +31 -0
- data/spec/api/image_spec.rb +115 -0
- data/spec/api/processor/image_magick_spec.rb +22 -0
- data/spec/api/processor_spec.rb +41 -0
- data/spec/fixtures/120x100.png +0 -0
- data/spec/start.rb +30 -0
- metadata +97 -0
@@ -0,0 +1,246 @@
|
|
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::CoreImage</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::CoreImage</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/miso/processor/core_image_rb.html">
|
59
|
+
lib/miso/processor/core_image.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
|
+
Processor
|
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
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000017">available?</a>
|
90
|
+
<a href="#M000018">crop</a>
|
91
|
+
<a href="#M000020">dimensions</a>
|
92
|
+
<a href="#M000019">fit</a>
|
93
|
+
<a href="#M000021">write</a>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<!-- if includes -->
|
101
|
+
|
102
|
+
<div id="section">
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<!-- if method_list -->
|
112
|
+
<div id="methods">
|
113
|
+
<h3 class="section-bar">Public Class methods</h3>
|
114
|
+
|
115
|
+
<div id="method-M000017" class="method-detail">
|
116
|
+
<a name="M000017"></a>
|
117
|
+
|
118
|
+
<div class="method-heading">
|
119
|
+
<a href="#M000017" class="method-signature">
|
120
|
+
<span class="method-name">available?</span><span class="method-args">()</span>
|
121
|
+
</a>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
<p><a class="source-toggle" href="#"
|
126
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000017-source">
|
128
|
+
<pre>
|
129
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/core_image.rb, line 4</span>
|
130
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">available?</span>
|
131
|
+
<span class="ruby-identifier">available</span> = <span class="ruby-identifier">$:</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">'osx/cocoa.rb'</span>) }
|
132
|
+
<span class="ruby-identifier">require</span> <span class="ruby-value str">'osx/cocoa'</span>
|
133
|
+
<span class="ruby-identifier">available</span>
|
134
|
+
<span class="ruby-keyword kw">end</span>
|
135
|
+
</pre>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
141
|
+
|
142
|
+
<div id="method-M000018" class="method-detail">
|
143
|
+
<a name="M000018"></a>
|
144
|
+
|
145
|
+
<div class="method-heading">
|
146
|
+
<a href="#M000018" class="method-signature">
|
147
|
+
<span class="method-name">crop</span><span class="method-args">(width, height)</span>
|
148
|
+
</a>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div class="method-description">
|
152
|
+
<p><a class="source-toggle" href="#"
|
153
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
154
|
+
<div class="method-source-code" id="M000018-source">
|
155
|
+
<pre>
|
156
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/core_image.rb, line 10</span>
|
157
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
|
158
|
+
<span class="ruby-comment cmt"># ...</span>
|
159
|
+
<span class="ruby-keyword kw">end</span>
|
160
|
+
</pre>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="method-M000020" class="method-detail">
|
166
|
+
<a name="M000020"></a>
|
167
|
+
|
168
|
+
<div class="method-heading">
|
169
|
+
<a href="#M000020" class="method-signature">
|
170
|
+
<span class="method-name">dimensions</span><span class="method-args">()</span>
|
171
|
+
</a>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div class="method-description">
|
175
|
+
<p><a class="source-toggle" href="#"
|
176
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
177
|
+
<div class="method-source-code" id="M000020-source">
|
178
|
+
<pre>
|
179
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/core_image.rb, line 18</span>
|
180
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dimensions</span>
|
181
|
+
<span class="ruby-comment cmt"># ...</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000019" class="method-detail">
|
189
|
+
<a name="M000019"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000019" class="method-signature">
|
193
|
+
<span class="method-name">fit</span><span class="method-args">(width, height)</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p><a class="source-toggle" href="#"
|
199
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
200
|
+
<div class="method-source-code" id="M000019-source">
|
201
|
+
<pre>
|
202
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/core_image.rb, line 14</span>
|
203
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
|
204
|
+
<span class="ruby-comment cmt"># ...</span>
|
205
|
+
<span class="ruby-keyword kw">end</span>
|
206
|
+
</pre>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="method-M000021" class="method-detail">
|
212
|
+
<a name="M000021"></a>
|
213
|
+
|
214
|
+
<div class="method-heading">
|
215
|
+
<a href="#M000021" class="method-signature">
|
216
|
+
<span class="method-name">write</span><span class="method-args">(output_file)</span>
|
217
|
+
</a>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<div class="method-description">
|
221
|
+
<p><a class="source-toggle" href="#"
|
222
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
223
|
+
<div class="method-source-code" id="M000021-source">
|
224
|
+
<pre>
|
225
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/core_image.rb, line 22</span>
|
226
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
|
227
|
+
<span class="ruby-comment cmt"># ...</span>
|
228
|
+
<span class="ruby-keyword kw">end</span>
|
229
|
+
</pre>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
</div>
|
239
|
+
|
240
|
+
|
241
|
+
<div id="validator-badges">
|
242
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
</body>
|
246
|
+
</html>
|
@@ -0,0 +1,345 @@
|
|
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::ImageMagick</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::ImageMagick</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/miso/processor/image_magick_rb.html">
|
59
|
+
lib/miso/processor/image_magick.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
|
+
Processor
|
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
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000009">available?</a>
|
90
|
+
<a href="#M000014">convert</a>
|
91
|
+
<a href="#M000010">crop</a>
|
92
|
+
<a href="#M000012">dimensions</a>
|
93
|
+
<a href="#M000016">ensure_output_directory</a>
|
94
|
+
<a href="#M000011">fit</a>
|
95
|
+
<a href="#M000015">operations</a>
|
96
|
+
<a href="#M000013">write</a>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
<div id="includes">
|
105
|
+
<h3 class="section-bar">Included Modules</h3>
|
106
|
+
|
107
|
+
<div id="includes-list">
|
108
|
+
<span class="include-name">Executioner</span>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div id="section">
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<div id="aliases-list">
|
117
|
+
<h3 class="section-bar">External Aliases</h3>
|
118
|
+
|
119
|
+
<div class="name-list">
|
120
|
+
<table summary="aliases">
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">convert</td>
|
123
|
+
<td>-></td>
|
124
|
+
<td class="context-item-value">_convert</td>
|
125
|
+
</tr>
|
126
|
+
</table>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<!-- if method_list -->
|
135
|
+
<div id="methods">
|
136
|
+
<h3 class="section-bar">Public Class methods</h3>
|
137
|
+
|
138
|
+
<div id="method-M000009" class="method-detail">
|
139
|
+
<a name="M000009"></a>
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<a href="#M000009" class="method-signature">
|
143
|
+
<span class="method-name">available?</span><span class="method-args">()</span>
|
144
|
+
</a>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<div class="method-description">
|
148
|
+
<p><a class="source-toggle" href="#"
|
149
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000009-source">
|
151
|
+
<pre>
|
152
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 12</span>
|
153
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">available?</span>
|
154
|
+
<span class="ruby-value">`which convert`</span>
|
155
|
+
<span class="ruby-identifier">$?</span>.<span class="ruby-identifier">success</span>
|
156
|
+
<span class="ruby-keyword kw">end</span>
|
157
|
+
</pre>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
163
|
+
|
164
|
+
<div id="method-M000014" class="method-detail">
|
165
|
+
<a name="M000014"></a>
|
166
|
+
|
167
|
+
<div class="method-heading">
|
168
|
+
<a href="#M000014" class="method-signature">
|
169
|
+
<span class="method-name">convert</span><span class="method-args">(source_path, output_path, options)</span>
|
170
|
+
</a>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="method-description">
|
174
|
+
<p><a class="source-toggle" href="#"
|
175
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
176
|
+
<div class="method-source-code" id="M000014-source">
|
177
|
+
<pre>
|
178
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 43</span>
|
179
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">source_path</span>, <span class="ruby-identifier">output_path</span>, <span class="ruby-identifier">options</span>)
|
180
|
+
<span class="ruby-identifier">ensure_output_directory</span>(<span class="ruby-identifier">output_path</span>)
|
181
|
+
<span class="ruby-identifier">_convert</span> <span class="ruby-node">"'#{source_path}' #{options} '#{output_path}'"</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000010" class="method-detail">
|
189
|
+
<a name="M000010"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000010" class="method-signature">
|
193
|
+
<span class="method-name">crop</span><span class="method-args">(width, height)</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p><a class="source-toggle" href="#"
|
199
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
200
|
+
<div class="method-source-code" id="M000010-source">
|
201
|
+
<pre>
|
202
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 17</span>
|
203
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
|
204
|
+
<span class="ruby-identifier">dimensions</span> = <span class="ruby-node">"#{width}x#{height}"</span>
|
205
|
+
<span class="ruby-identifier">operations</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"-resize #{dimensions}^ -gravity center -crop #{dimensions}+0+0!"</span>
|
206
|
+
<span class="ruby-keyword kw">end</span>
|
207
|
+
</pre>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div id="method-M000012" class="method-detail">
|
213
|
+
<a name="M000012"></a>
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<a href="#M000012" class="method-signature">
|
217
|
+
<span class="method-name">dimensions</span><span class="method-args">()</span>
|
218
|
+
</a>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
<p><a class="source-toggle" href="#"
|
223
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
224
|
+
<div class="method-source-code" id="M000012-source">
|
225
|
+
<pre>
|
226
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 26</span>
|
227
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dimensions</span>
|
228
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">info</span> = <span class="ruby-identifier">identify</span>(<span class="ruby-identifier">input_file</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">match</span> = <span class="ruby-regexp re">/\s(\d+)x(\d+)\+/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">info</span>)
|
229
|
+
<span class="ruby-identifier">match</span>.<span class="ruby-identifier">to_a</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">2</span>].<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">to_i</span> }
|
230
|
+
<span class="ruby-keyword kw">end</span>
|
231
|
+
<span class="ruby-keyword kw">end</span>
|
232
|
+
</pre>
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div id="method-M000011" class="method-detail">
|
238
|
+
<a name="M000011"></a>
|
239
|
+
|
240
|
+
<div class="method-heading">
|
241
|
+
<a href="#M000011" class="method-signature">
|
242
|
+
<span class="method-name">fit</span><span class="method-args">(width, height)</span>
|
243
|
+
</a>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<div class="method-description">
|
247
|
+
<p><a class="source-toggle" href="#"
|
248
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
249
|
+
<div class="method-source-code" id="M000011-source">
|
250
|
+
<pre>
|
251
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 22</span>
|
252
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
|
253
|
+
<span class="ruby-identifier">operations</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"-resize #{width}x#{height}"</span>
|
254
|
+
<span class="ruby-keyword kw">end</span>
|
255
|
+
</pre>
|
256
|
+
</div>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div id="method-M000013" class="method-detail">
|
261
|
+
<a name="M000013"></a>
|
262
|
+
|
263
|
+
<div class="method-heading">
|
264
|
+
<a href="#M000013" class="method-signature">
|
265
|
+
<span class="method-name">write</span><span class="method-args">(output_file)</span>
|
266
|
+
</a>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div class="method-description">
|
270
|
+
<p><a class="source-toggle" href="#"
|
271
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000013-source">
|
273
|
+
<pre>
|
274
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 32</span>
|
275
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
|
276
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">operations</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
|
277
|
+
<span class="ruby-identifier">operations</span>.<span class="ruby-identifier">clear</span>
|
278
|
+
<span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span>)
|
279
|
+
<span class="ruby-keyword kw">end</span>
|
280
|
+
</pre>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<h3 class="section-bar">Private Instance methods</h3>
|
286
|
+
|
287
|
+
<div id="method-M000016" class="method-detail">
|
288
|
+
<a name="M000016"></a>
|
289
|
+
|
290
|
+
<div class="method-heading">
|
291
|
+
<a href="#M000016" class="method-signature">
|
292
|
+
<span class="method-name">ensure_output_directory</span><span class="method-args">(path)</span>
|
293
|
+
</a>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div class="method-description">
|
297
|
+
<p><a class="source-toggle" href="#"
|
298
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
299
|
+
<div class="method-source-code" id="M000016-source">
|
300
|
+
<pre>
|
301
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 54</span>
|
302
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_output_directory</span>(<span class="ruby-identifier">path</span>)
|
303
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">path</span>))
|
304
|
+
<span class="ruby-keyword kw">end</span>
|
305
|
+
</pre>
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div id="method-M000015" class="method-detail">
|
311
|
+
<a name="M000015"></a>
|
312
|
+
|
313
|
+
<div class="method-heading">
|
314
|
+
<a href="#M000015" class="method-signature">
|
315
|
+
<span class="method-name">operations</span><span class="method-args">()</span>
|
316
|
+
</a>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
<p><a class="source-toggle" href="#"
|
321
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
322
|
+
<div class="method-source-code" id="M000015-source">
|
323
|
+
<pre>
|
324
|
+
<span class="ruby-comment cmt"># File lib/miso/processor/image_magick.rb, line 50</span>
|
325
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">operations</span>
|
326
|
+
<span class="ruby-ivar">@operations</span> <span class="ruby-operator">||=</span> []
|
327
|
+
<span class="ruby-keyword kw">end</span>
|
328
|
+
</pre>
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
|
334
|
+
</div>
|
335
|
+
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
|
340
|
+
<div id="validator-badges">
|
341
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</body>
|
345
|
+
</html>
|