BuddyDev

Search

[Resolved] Thumbnail size in activity feed

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13215

    Using MediaPress, the activity feed is displaying images in various sizes. I’ve looked at activity/views/grid-photo.php and it’s pulling mpp_media_src( 'thumbnail' ) which seems correct. And the MP settings are for 200×200 for Media-size-settings-thumbnail. However the images which are loaded vary in size between 130×230, 200×113, 680×1024, 768×1024, and so forth.

    For display purposes this is not an issue, because I’m using CSS to downsize the image to a ‘proper thumbnail’ size, and the lightbox shows the large size, for instance. However, I don’t want to pull a 768×1024 image in the first place. I only want the thumbnail.

    Is there anything I can do about this via MP…?

    Thanks for any helpful assistance.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #13217

    Hi Richard,
    Sorry about that. Do you have cropping enabled in the admin settings for MediaPress? Cropping should set a hard size for the image.

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13231

    aha (slaps head), I see the crop setting now!

    Probably a silly question, but I’m presuming this will crop to maximum sizes on width and/or height, and not simply crop square to the size specified? If so, perhaps the tooltip could be improved, *something* like:

    Media Thumbnail size. If crop is enabled, photo will be cropped to the size. to

    Media Thumbnail size. If crop is enabled, photo will be cropped to the maximum sizes.

    One more question related to this. I expect this to function on upload. Existing images will need to be recropped via ImageMagick resize or somesuch?

    R.

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13232

    Ah, no the crop is literal and hard crops to a square 200×200 image. Hmm, maybe it would make sense here to have an additional checkbox option:

    crop to literal size or crop to maximum size per width/height

    If you follow what I mean?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #13233

    Hi Richard,
    We are using

    WP_Image_Editor::multi_resize()
    

    and it hard crops to the given limit if the crop is enabled.

    There is a filter

    
    $sizes = apply_filters( 'mpp_intermediate_image_sizes', $sizes, $attachment_id );
    
    

    where you can filter the size/modify the args but I am not sure if that will be much helpful to you.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13238

    hi Brajesh,

    I’m happy with the settings, I’m just not happy with what they do, or maybe I misunderstand something. Let’s take an example, I have a portrait image of 400×800.

    With a setting of thumbnail = 200x200 and no to crop, I’d expect it to be cropped but only to the longest length [eg.1], so I would get 100×200. Or if cropped to the shortest length [eg.2], then 200×400. If no crop means no crop at all [eg.3] then 400×800.

    With a setting of thumbnail = 200x200 and yes to crop, I’d expect it to be cropped hard [eg.4] to 200×200

    Does this make my issue clearer?

    R.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #13239

    Hi Richard,
    Thank you.

    I am sorry but the way WordPress resizes image is not that way.

    It will resize alongside the lowest dimension(Opposite of what expectation is).

    Since we are using the WordPress Image Editor and don’t have our own implementation, so these resizes/crops behave on the same line as the core.

    Hope that clarifies.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13240

    hi Brajesh,

    thanks for your patience. When you say ‘lowest dimension’, which of the examples I gave above fits your description? [eg.1,2,3,4]?

    R.

  • Participant
    Level: Master
    Posts: 279
    Richard Foley on #13247

    hi Brajesh,

    rereading your reply I see that when you say ‘lowest dimension’ (I think) you mean ‘shortest length’ [eg.2]

    If so, this would produce, from the original 400×800 in my example and with crop=no, a ‘thumbnail’ of 200×400. Am I barking up the correct tree here?

    R.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #13248

    Hi Richard,
    If you are resizing it, it will be 100×200 and if you are cropping, it will be 200×200.

    Please see this article to understand WordPress cropping/Resizing modes.
    https://www.davidtan.org/wordpress-hard-crop-vs-soft-crop-difference-comparison-example/

    Hope that helps.

    Regards
    Brajesh

The topic ‘ [Resolved] Thumbnail size in activity feed’ is closed to new replies.

This topic is: resolved