However, there were a few factors that made it unsuitable for
many applications:
??? It is tied to RMagick (and therefore ImageMagick) for image processing.
ImageMagick is notoriously difficult to install, primarily because it depends on
many backend libraries for processing different image formats. At the time
acts_as_attachment was written, ImageMagick was the best option. Now, however,
there is a lighter alternative, ImageScience, based on the FreeImage library.
??? The entire attachment data must be read into memory and converted to a Ruby
string. For large files, this is expensive??”Rails passes the application a TempFile,
which is slurped into a String. If using filesystem storage, the string is then written
back out into a file!
??? There is no support for alternative storage methods such as Amazon??™s S3.
Luckily, there is an alternative. Rick has rewritten acts_as_attachment to resolve
these issues. The rewrite is called attachment_fu, and it is publicly available at http://
svn.techno-weenie.net/projects/plugins/attachment_fu/.
The attachment_fu library supports all of acts_as_attachment??™s options and more.
It can use RMagick as a processor, but it also supports MiniMagick (a lightweight
alternative to RMagick that still wraps ImageMagick) and ImageScience. It can store
attachments in a database, the filesystem, or S3 out of the box. It also has great
facilities for expansion; it is easy to write your own processor or storage backend.
Pages:
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