Page_attachments thumbnails


#1

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.


#2

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 B.
Tel: +49-7731-79838380
removed_email_address@domain.invalid
http://keithbingman.com


#3

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


#4

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 B.
Tel: +49-7731-79838380
removed_email_address@domain.invalid
http://keithbingman.com


#5

Awesome, Keith. I’ll put that in the extension right away.

Sean


#6

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 B.
Tel: +49-7731-79838380
removed_email_address@domain.invalid
http://keithbingman.com


#7

If you would like, I can send you the code I have.

Keith B.
Tel: +49-7731-79838380
removed_email_address@domain.invalid
http://keithbingman.com