Forum: Radiant CMS page_attachments thumbnails

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.
D479f3cae722685d28bf4eefa1b9c0a5?d=identicon&s=25 Jonathan M. (jmetillon)
on 2007-06-06 09:53
(Received via mailing list)
Hi,

I have page_attachments installed and running on Radiant edge. I also
have MiniMagick installed. gem list shows:

mini_magick (1.2.0)
    Manipulate images with minimal use of memory.

The <r:attachment:image /> tag works very well!

But in the Available Tags list, I can't see anything related to
generating a thumbnail. Is there something like
<r:attachment:thumbnail /> ?

Thank you.

J.
Keith Bingman (Guest)
on 2007-06-06 13:13
(Received via mailing list)
In order to generate a thumbnail with MiniMagick, you need to set the
processor to :mini_magick. You can do this in the PageAttachments
model, just where it says "has_attachment".

I have written my own tags that allow you to access the thumbnails,
but these are currently not in page_attachments. It is a very easy
tag to add, you just have to understand how attachment_fu works.
There is a good tutorial on attachment_fu at http://clarkware.com/cgi/
blosxom/2007/02/24#FileUploadFu, which shows all the various parameters.

Keith Bingman
Tel: +49-7731-79838380
keith@keithbingman.com
http://keithbingman.com
Sean Cribbs (Guest)
on 2007-06-06 14:29
(Received via mailing list)
There's no specific support for thumbnails, other than being generated
to support the UI.  They are 50x50 by default. Would a "thumbnail" tag
be helpful?

Sean
Keith Bingman (Guest)
on 2007-06-06 14:40
(Received via mailing list)
I solved it by writing an image tag with a "size" attribute. This
just passes a key to the public_filename in attachment_fu. Then I can
make and access any size I want using something like
<r:attachment:image size="thumbnail" /> with calls the image path
with "public_filename(:thumbnail)". This gives me a great deal of
flexibility to autogenerate specific sizes and easily call them.

Keith Bingman
Tel: +49-7731-79838380
keith@keithbingman.com
http://keithbingman.com
Sean Cribbs (Guest)
on 2007-06-06 14:42
(Received via mailing list)
Awesome, Keith.  I'll put that in the extension right away.

Sean
Keith Bingman (Guest)
on 2007-06-06 14:46
(Received via mailing list)
If you would like, I can send you the code I have.

Keith Bingman
Tel: +49-7731-79838380
keith@keithbingman.com
http://keithbingman.com
Keith Bingman (Guest)
on 2007-06-06 14:51
(Received via mailing list)
I forgot, I did something similar on the link tag, so that you can
make links to specific image sizes as well. I don't use this one
much, but it is good for embedding light box images in blog posts and
such. Like this: /http://bitchkittyracing.com/articles/keiths-visit-
days-0-1/

Keith Bingman
Tel: +49-7731-79838380
keith@keithbingman.com
http://keithbingman.com
This topic is locked and can not be replied to.