/
index.html
233 lines (217 loc) · 11.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Emphasized Insanity - attachment_fu and minimagick resize bug</title>
<link href="/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css">
<link href="/stylesheets/bundle_common.css" media="screen" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf-8">
var GitHub = {}
var github_user = 'eladmeidar'
</script>
<script src="/javascripts/jquery.js" type="text/javascript"></script>
<script src="/javascripts/bundle_common.js" type="text/javascript"></script>
<script src="/javascripts/bundle_github.js" type="text/javascript"></script>
<link href="http://blog.eizesus.com/feed/atom.xml" rel="alternate" title="Emphasized Insanity" type="application/atom+xml">
<meta name="description" content="Ruby on Rails developer blog">
</head>
<body>
<div class="subnavd" id="main">
<div id="header" class="pageheaded">
<div class="site">
<div class="logo">
<a href="/"><h1>Emphasized Insanity</h1></a>
</div>
<div class="userbox">
<div class="inner">
<div class="avatarname">
<a href="http://github.com/eladmeidar"><img alt="" src="/images/eladmeidar.jpg" height="20" width="20"></a>
<a href="http://twitter.com/eladmeidar" class="name">@eladmeidar</a>
</div>
<ul class="usernav">
<li><a href="/about.html">About me</a></li>
<li><a href="http://www.linkedin.com/in/eladmeidar">LinkedIn</a></li>
<li><a href="http://workingwithrails.com/person/5844-elad-meidar">WWR</a></li>
<li><a href="http://github.com/eladmeidar">GitHub</a></li>
<li><a href="http://www.nautilus6.com">My Company</a></li>
</ul>
</div>
</div><!-- /.userbox -->
<div class="topsearch">
<form action="http://www.google.com/search?sitename=blog.eizesus.com" id="top_search_form" method="get">
<input autocomplete="off" class="search my_repos_autocompleter notnative placeholder ac_input" name="q" results="5" placeholder="Search…" type="search"> <input value="Search" class="button" type="submit">
<input type="hidden" name="sitesearch" value="blog.eizesus.com" checked=""/>
</form>
<ul class="nav">
<li><a href="/archive.html">Explore Emphasized Insanity</a></li>
</ul>
</div>
</div>
</div>
<div class="site">
<div class="pagehead repohead vis-public">
<h1> <a href="/">Emphasized Insanity</a> / <strong><a href="/">Blog</a></strong> </h1>
<ul class="actions">
<li> <a href="http://blog.eizesus.com/feed/atom.xml" class="minibutton btn-watch " id="watch_button" style=""><span><span class="icon"></span>Subscribe</span></a></li>
<li class="for-notforked" style=""><a href="#disqus-comments" class="minibutton btn-fork " id="fork_button"><span><span class="icon"></span>Comment</span></a></li>
</ul>
<ul class="tabs">
<li><a href="/" class="selected" highlight="repo_source">Source</a></li>
<li><a href="/archive.html" highlight="repo_commits">Archive</a></li>
<li><a href="http://www.railsbridge.org" highlight="issues">RailsBridge</a></li>
<li class="contextswitch nochoices">
<span class="toggle leftwards">
<em>Branch:</em>
<code>master</code>
</span>
</li>
</ul>
<div class="subnav-bar">
<ul>
<li>
<a href="#" class="dropdown">Switch Branches (1)</a>
<ul>
<li><strong>master ✓</strong></li>
</ul>
</li>
</ul>
</div>
<div id="repo_details" class="metabox clearfix pledgified">
<div id="repo_details_loader" class="metabox-loader" style="display: none;">Sending Request…</div>
<a href="#pledgie_box" rel="facebox" title="Brought to you by pledgie.com" class="pledgie pledgie-button for-owner tooltipped" id="activate_pledgie_button" style="display: none;"><span>Enable Donations</span></a>
<div id="pledgie_box" style="display: none;">
<h2>Pledgie Donations</h2>
</div>
<div id="repository_description" rel="repository_description_edit">
<p>
This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I am a proud member of <a href="http://www.railsbridge.org">RailsBridge</a>, Helping new <a href="http://www.railsmentors.org/users/185">Rails developers</a> get into our world and also contributed a few <a href="http://contributors.rubyonrails.org/contributors/elad-meidar/commits">Patches</a> to the Ruby on Rails core.
</p>
<p>
I hang around Fort Lauderdale, FL and Tel-Aviv in Israel, and i am currently running <a href="http://www.nautilus6.com">Nautilus6</a> so Feel free to contact me regarding projects :).
</p>
</div>
</div>
</div><!-- /.pagehead -->
<div id="commit">
<div class="group">
<div class="envelope commit">
<div class="human">
<div class="message"><pre>Recent Posts</pre></div>
<div class="actor">
<div class="gravatar">
<img alt="" src="images/eladmeidar.jpg" height="30" width="30">
</div>
<div class="name"><a href="/">Elad Meidar</a>
<span>(author)</span>
</div>
<div class="date">
<abbr class="relatize relatized" title="1984-06-19 06:06:07">about 25 years ago</abbr>
</div>
</div>
</div>
<div class="machine">
<span>c</span>ommit <a href="#" hotkey="c">60fa264c54341711baef087347105a5b9dd68863</a><br>
<span>t</span>ree <a href="#" hotkey="t">508268ee6774e5c6060585718705f1ec7afa80d8</a><br>
<span>p</span>arent <a href="#" hotkey="p">179f7c0440e6073779efc40366c6ced3a9888f71</a>
</div>
</div>
</div>
</div>
<div id="path">
<b><a href="/2008/11/attachment_fu-and-minimagick-resize-bug-2">attachment_fu and minimagick resize bug</a></b> /
</div>
<div id="browser">
<table cellpadding="0" cellspacing="0">
<tbody><tr>
<th></th>
<th width="400p">name</th>
<th>age</th>
<th>
history
</th>
</tr>
<tr class="alt">
<td class="icon"> <img alt="file" src="/images/txt.png"> </td>
<td class="content">
<a href="/2008/11/attachment_fu-and-minimagick-resize-bug-2" id="d8f8d46921aa81abc4c0d27703a8908333ae38c3">attachment_fu and minimagick resize bug</a>
</td>
<td class="age">
<span class="relatize relatized">24/11/2008</span>
</td>
<td class="message">
<a href="/2008/11/attachment_fu-and-minimagick-resize-bug-2" class="message" title="another post">Another post</a> [Elad Meidar]
</td>
</tr>
</tbody></table>
</div>
<div id="readme" class="announce"><span class="name"></span>
<div class="wikistyle">
<p>In one of my latest projects i was using the attachement_fu plugin to handle image uploads.<br />The attachement_fu plugin enables the option to select an image processor engine between <a href="http://seattlerb.rubyforge.org/ImageScience.html">ImageScience</a>, <a href="http://rmagick.rubyforge.org/">Rmagick</a> add <a href="http://rubyforge.org/projects/mini-magick/">MiniMagick</a>:<br /><ol><li>Rmagick<br />Kinda bulky, leaking but fully functional<br /></li><li>MiniMagick<br />Simple version of Rmagick, simple and small.</li><li>ImageSceince<br />Small, nice, and quick.</li></ol>i decided to use MiniMagick as my processor, i installed the gem:<br />
<pre><br />
sudo gem install mini_magick<br />
</pre> and added a specific <code>:processor</code> option to my Logo model.<br />
<pre class="brush:ruby"><br />
has_attachment :content_type => :image, <br />
:storage => :file_system, <br />
:max_size => 2.megabytes,<br />
:resize_to => ‘x100’,<br />
:processor => :mini_magick<br />
</pre><br />
but when i was uploading an image, i was was expecting it to be resized based on the options i specified in the model. imagine how surprised i was when i found out that the image is not being resized.<br />
checking the log found the following error:<br />
<pre class="brush: plain"><br />
Exception working with image: ImageMagick command (identify “/var/folders/Bv/Bvbna8-OH548ZWju8naF4U+++TI/-Tmp-/minimagick11451-0”) failed: Error Given 32512<br />
</pre><br />
Googling it didn’t help me much (except from finding other people with the same problem), so i decided to switch to use <a href="http://seattlerb.rubyforge.org/ImageScience.html">ImageScience</a> instead (RMagick is out of the question of course).<br />
<pre class="brush: bash"><br />
sudo gem install image_science<br />
</pre><br />
this will include all most all dependencies, but the <a href="http://seattlerb.rubyforge.org/ImageScience.html">freeImage</a> dependency is also needed.<br />
us mac/darwin users can simply use port:<br />
<pre class="brush: bash"><br />
sudo port selfupdate<br />
sudo port install freeimage<br />
</pre><br />
now change the processor in the model<br />
<pre class="brush: ruby"><br />
has_attachment :content_type => :image, <br />
:storage => :file_system, <br />
:max_size => 2.megabytes,<br />
:resize_to => ‘x100’,<br />
:processor => :image_science<br />
</pre><br />
and now it’s working. yeah!.</p>
</div>
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/emphasizedinsanity/embed.js"></script><noscript><a href="http://emphasizedinsanity.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</div>
<div class="push"></div>
</div>
<div id="footer">
<div class="site">
<div class="info">
<div class="links">
</div>
<div class="company">
<script type="text/javascript" src="http://s51.sitemeter.com/js/counter.js?site=s51eizesusrulez"></script>
<a href="http://feeds.feedburner.com/EladOnRails"><img src="http://feeds.feedburner.com/~fc/EladOnRails?bg=FFFFFF&fg=660033&anim=0" height="26" width="88" style="border:0" alt="" /></a>
</div>
</div>
<div class="sponsor">
<div>
</div>
</div>
</div>
<div id="facebox" style="display: none;"> <div class="popup">
<table> <tbody> <tr> <td
class="tl"></td><td class="b"></td><td class="tr"></td> </tr>
<tr> <td class="b"></td> <td
class="body"> <div class="content"> </div>
<div class="footer"> <a href="#"
class="close"> <img src="index_files/closelabel.gif"
title="close" class="close_image"> </a>
</div> </td> <td class="b"></td>
</tr> <tr> <td class="bl"></td><td
class="b"></td><td class="br"></td> </tr> </tbody>
</table> </div> </div></body></html>