Forum: Ruby on Rails Attachment_fu: save to a default format

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
13d7a3ab12ec57e0d372d7115362cb91?d=identicon&s=25 comopasta Gr (comopasta)
on 2009-01-19 08:51
Hi, would anyone have any advices on the next?

I allow users to upload images to my app. I'm using attachment_fu and
MiniMagick.
There's two things that I'd like to do:

1- No matter what format the original file is I'd like to save it in jgp
format.
2- I want to keep all images limited to say 1000px width, so resize if
they are bigger.

Is there a way to do that without much hassle?

Thanks.
Fac81a9d95c81d817a2debb6f717f3ac?d=identicon&s=25 Sazima (Guest)
on 2009-01-19 14:46
(Received via mailing list)
Resizing is a basic feature, take a look at the README. Format
transformation, on the other hand, is more difficult and is not a
known feature of attachemnt_fu...

Cheers, Sazima

On Jan 19, 5:51 am, comopasta Gr <rails-mailing-l...@andreas-s.net>
A39970d780c506b26e9a8b71eda13df2?d=identicon&s=25 Walter McGinnis (Guest)
on 2009-01-20 01:18
(Received via mailing list)
Here's an example of how to do what you want with Rmagick (probably
works in
principle with mini magick, but not sure):

http://github.com/kete/kete/blob/3ae3c179f86943ccc...

It's a module we mix in to monkey patch (i.e. redefine methods locally)
attachment_fu's built in processor code for Rmagick in the Kete app (
http://kete.net.nz).

Cheers,
Walter
13d7a3ab12ec57e0d372d7115362cb91?d=identicon&s=25 comopasta Gr (comopasta)
on 2009-01-20 06:51
Hi, thanks for the comments!

This is a great piece of information.

Regards.
This topic is locked and can not be replied to.