MG 2.2 Thumbnail crop

I'm not sure what node cropping you're referring to exactly -- article forums?

But the MG uses square crops. Any change to that would require code changes.
 
Okay I think what I'm seeing is the thumbs on a node post have a file name overlay. But the cropping seems to be the same. What is different is the sizing. I mentioned this in another post, which was never addressed and I think its a bug. I have attachments set to 150 X 150 in attachment settings and 200 x 200 in MG but the MG thumbs are smaller.
 

Attachments

  • mg_thumb.webp
    mg_thumb.webp
    9.6 KB · Views: 9
  • node_thumb.webp
    node_thumb.webp
    12.7 KB · Views: 9
  • attachment.webp
    attachment.webp
    18.1 KB · Views: 9
  • mg_size.webp
    mg_size.webp
    23.3 KB · Views: 9
There are a few things here. Basic attachment thumbnails aren't actually cropped; they maintain the original ratio. The size of the thumbnail is based on the shortest edge being the mentioned size. If you upload a 1000x500 image and have a thumbnail size of 150, then the generated thumbnail image will be 300x150.

XFMG will generate a thumbnail with the specific size entered, cropping to match the ratio (for consistency in its display mostly).

In both cases, the actual displayed size may vary based on external factors which may lead to the image being scaled to fit the necessary size. (For an inserted attachment for example, the size is independent of the thumbnail size; when you insert an attachment into a post, you'd get the "real" thumbnail size.) XFMG's lists do some proportional scaling in the CSS that varies across device size and exact usage requirements, including buffers so that the images always take up the full width of a row with "liquid" display sizes.

So if you wanted to change that scaling ratio in XFMG, it would require direct CSS changes (xfmg_item_list.less, see the .itemList-item rules). These are based on the thumbnail size you choose so they will differ depending on thumbnail size; the CSS specifically relates to potentially changing the scaling rules used.
 
I guess as an end user I'm just looking for consistency and don't "didn't" understand why the two products don't display the same.

Maybe crop is not the right word for me to be using. When I view an image thumb on either a post or in the MG the thumb has the outside of the image trimmed compared to when you open it full size. Can the amount of trimming be controlled?
 
Essentially, the only direct control you have here is based on the ratio you have set for the XFMG thumbnail size. If you set it to 300x300, it will take a square crop from the image; if you set it to 300x200, you'll get a rectangle (wider than tall) which means you'd see more of a landscape-orientation image, but you'd effectively get less of a portait-oriented image (and vice versa for 200x300).

In terms of posts, the visual appearance of cropping only applies to attachments that aren't embedded in the post (the ones shown in the "attachments" list at the end). If you simply insert the attachments into the post, the thumbnails there aren't cropped from the original. But in terms of the attachment list, there isn't any direct control over it; you'd need to make CSS changes to change the size/ratio of these items.
 
Mike,

Thanks for the explanation. I'm trying to make sense of this.

If I set my attachments to 150 X 150 for forum posts, then I set MG to 150 X 150. Why don't I get the same thing with the same image?
 
The cropping approach is different in the ways I mentioned above (shortest edge vs specific dimensions) based roughly on the use case/needs of each system. There isn't any way to change this beyond what I've mentioned, unless you start getting into custom CSS or PHP changes.
 
Back
Top Bottom