Topic: previewing files uploaded with attachment_fu

say a user uploads an .mpg or .avi can  i generate randomly a thumbnail of the video file?

sort of like youtube, where there are thumbnails under the video files, that display different time frames of the video.

Re: previewing files uploaded with attachment_fu

there are callback methods in in attachment_fu, after_attachment_saved maybe you could override it.

you can use rmagick to grab a frame from a movie, but from what i've tried in the past it must go though dump the entrie movie to tmp directory before giving you a single frame.

but look at the attachment_fu.rb source for comments about callbacks and you should see them. and check out the rmagick/imagemagick commands something like this

convert -strip -size 96x96 -resize '96x96>' test.mpg[0]  out.jpg

the array index zero supposedly is supposed to grab the first frame only, but still process for a long time leading me to believe its dumping the whole thing to a temp folder.

i dont have this working in a production environment or anything so ymmv, but maybe it helps somewhat.