Image thumbnails?

Galen King's Avatar

Galen King

26 Jan, 2010 08:16 AM via web

Perhaps I've completely missed it but I can't see anything covering thumbnails anywhere in the docs.

Do you plan to have a thumbnail filter?

Cheers,

Galen

  1. 2 Posted by John Nunemaker on 26 Jan, 2010 12:46 PM

    John Nunemaker's Avatar

    Right now it makes a thumb for each asset but the size is not
    changeable. Eventually we would like to allow specifying versions.

  2. 3 Posted by Galen King on 27 Jan, 2010 09:12 PM

    Galen King's Avatar

    FYI, we developed a liquid filter for Mephisto that works like this:

    {{ imageobject | thumbnail: 500 }} would create an image 500px wide

    {{ imageobject | thumbnail: 'medium', '>500x500' }} would create an image that fits within a 500 x 500px square IF the original's greater than 500px. The 2nd parameter is basically the RMagick parameter string.

    We used RMagick because it was part of attachment_fu (I think). Would have preferred something like Paperclip.

    The biggest drawback of our thumbnailing system is that it doesn't allow for "zoomcrop" whereby, you specify, say, 500px wide x 200px high, it will crop the image to fit these proportions. That, from my experience, is crucial to being able to create beautiful layouts that a client can add to easily with no fuss and no hassle.

    Where do you guys stand on this?

    Cheers,

    Galen

  3. 4 Posted by John Nunemaker on 27 Jan, 2010 09:28 PM

    John Nunemaker's Avatar

    That is an interesting idea but I don't want to have imagemagick getting
    involved when we are rendering the front side stuff. That would really
    hinder performance. More likely, we would allow you to set styles in the
    admin for assets and file upload field types that would do the same thing.
    Then in the view you would do something like paperclip:

    {{ item.pic.thumb_url }}

    Or something like that. Make sense? We definitely want to do something like
    this, but it is towards the bottom of the queue right now.

  4. 5 Posted by Galen King on 27 Jan, 2010 09:31 PM

    Galen King's Avatar

    Sorry, our thumbnailing is done (I think) when the page is saved. The thumbnails are then stored (cached). They are not generated on-the-fly.

    Having said all that, our system had major limitations from the user’s perspective in that all thumbnailing was done in the templates. If a user placed an image in the content, we couldn’t do any thumbnailing at all and that’s a bit of a pain.

    I look forward to seeing what you come up with.

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

What number comes after 20?

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Recent Discussions

27 Jan, 2012 07:18 PM
24 Jan, 2012 04:02 PM
19 Jan, 2012 10:31 AM
17 Jan, 2012 01:02 AM