Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageGallery - why are thumbnails cropped?

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 890 Views
  • redactuk
    Avatar
    Community Member
    115 Posts

    ImageGallery - why are thumbnails cropped? Link to this post

    Why are thumbnails first having about 10px or so cropped on all sides THEN resized to the thumbnail dimensions specified?

    I've searched through the code but just can't seem to find where this extra is being removed from the edges

    A pointer to the code where I can change this would be appreaciated

    Thank

  • UncleCheese
    Avatar
    4085 Posts

    Re: ImageGallery - why are thumbnails cropped? Link to this post

    Right now the ImageGallery supports only square thumbnails. I'll be adding in a height attribute for the thumbnails very soon, but understand they will always have to be a predictable height, otherwise the CSS will break, not to mention it looks awkward. So there will always have to be some amount of cropping for dimensions that do not conform to the aspect ratio of the original photo.

  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: ImageGallery - why are thumbnails cropped? Link to this post

    Thanks for reply.

    I looked into imaging code a little more after posting this and saw mention of the need to crop images in order to maintain aspect ratio. The issue is that I've been comparing thumbs generated here with thumbs generated manually on an old site I'm wanting to convert to SS. The issue with many thumbs is that the cropping is of course not taking into account the content, so where an image (with larger height then width) had some text at the top, the auto-cropping is removing part of the bottom and top of the image and so cropping off the readable text. I guess no auto-resizing code can ever really factor in the content

    When are thumbs generated? are they generated on the-fly or at import? Reason I ask is can I go and replace those in _resampled and be safe that they won't be overwritten?

    890 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.