Uploading MP3 now gives identify error

22 views
Skip to first unread message

yaphi

unread,
Jul 1, 2009, 2:23:05 PM7/1/09
to Paperclip Plugin
Hello,

I've been using Paperclip on a site for a while for uploading files. I
just recently upgraded to the latest version of the plugin and now
when my users upload anything other than an image I get the ____ is
not recognized by the 'identify' command error.

This is ImageMagik trying to resize an mp3 I figure. My question is,
what changed in the new Paperclip to not ignore mp3's and other types
when it came to resizing?

yaphi

unread,
Jul 1, 2009, 2:51:52 PM7/1/09
to Paperclip Plugin

Ah I jumped the gun this seems to be a phusion error again as I just
updated that as well. This is happening on production now however so
it's not the ImageMagick / Mac OS hack from before. Anyone have any
suggestions?

I can upload images, but nothing else.

Jonathan Yurek

unread,
Jul 1, 2009, 3:19:47 PM7/1/09
to papercli...@googlegroups.com
What are you processors, and what does your definition look like?
Should you be trying to run mp3s through the thumbnail processor at all?
--
Jonathan Yurek, Founder and CTO
thoughtbot, inc.
organic brains. digital solutions.

617.482.1300 x114
http://www.thoughtbot.com/

yaphi

unread,
Jul 1, 2009, 3:26:41 PM7/1/09
to Paperclip Plugin
Here is how I have it setup but this worked fine before for any type
of filetype. Did something change in the Paperclip plugin? I want to
be able to have an asset that can be either image or audio or video,
and I deal with it based on content-type later.

has_attached_file :data,
:styles => { :medium => "307x", :small =>
"73x52#" },
:url => "/system/
assets/:id/:style_:basename.:extension",
:path => ":rails_root/public/system/
assets/:id/:style_:basename.:extension"


validates_presence_of :title, :description, :artist_id, :message
=> "can't be blank"
validates_attachment_presence :data
validates_attachment_content_type :data, :content_type => ["image/
jpeg", "image/pjpeg", "application/x-octet-stream", "application/octet-
stream", "video/x-flv", "flv-application/octet-stream", "audio/mpeg",
"audio/x-m4a", "audio/mp3", "audio/x-mp3"], :message => "must be in
the correct format"

Jonathan Yurek

unread,
Jul 1, 2009, 3:36:05 PM7/1/09
to papercli...@googlegroups.com
So what exactly is happening when you upload a sound or video file? Is
anything being saved? Is the record itself being saved? Are there
validation errors?

You could try having a before_post_process handler that will stop post-
processing if the file is not an image. That may work.
Reply all
Reply to author
Forward
0 new messages