Support » Plugin: WPAdverts - Classifieds Plugin » Image sizing and crop issues

  • bdd

    (@bws-online)


    I’ve read the documentation on image sizing and I’ve done some testing and it seems like something’s not quite right.

    I left the image sizes at the defaults:

    • Adverts Gallery 650×300
    • Adverts List 310×190
    • Upload Thumbnail 150×105

    I also tried both with and without “crop image” checked.

    Main concerns:
    – On the slider on an individual advert page it’s showing the image at 750×350 (intrinsic 650×300).
    – Even if no crop is selected, it seems to be cropping the slider image to that 750×350.
    – Preview is stretching images to 1140×350 (and also cropping).
    – List view is cropping the image to 100×61 (even with no crop selected).

    Can you please direct me to something that makes this make more sense?

    I think the main issues are primarily:
    – Is there a place to edit the way the individual advert page image is sized?
    – Is there a place to edit the way the preview is shown?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    The WPAdverts does not resize images on it’s own it only registers new images sizes using add_image_size() function https://developer.wordpress.org/reference/functions/add_image_size/ and WordPress is generating thumbnails without any additional WPAdverts help. The image thumbnails can be however affected by some other plugin which customizes thumbnails.

    On the Ad details page, the image will be always scaled to fill the whole space in the slider, this means the image should be in the size set in the gallery options but it can be stretched or shrunken, which from your description seems to be the case here. It looks like you are confusing cropping with having the images scaled by CSS.

    By preview do you mean the image shown in the lightbox after clicking on it? If so then it should show image in the original size.

    Similarly as on the Ad details page the [adverts_list] is scaling the images to 100x61px using CSS, the actual image size should be 310×190 as set in configuration.

    bdd

    (@bws-online)

    Thank you for the details.

    What is determining the space for the width of the content for the ad? Is that something controlled within the plugin settings and/or the CSS for the plugin, or is it something from my theme? It’s definitely stretching all the content for the ad (including the primary image) to 750px wide.

    No, I understand the difference between cropping and scaling. I’ll explore again, but it wasn’t working as expected (for either).

    By preview I mean the preview of the ad when you add an ad — the button at that point says “Preview” — you choose that, and it shows the image really large and both stretched and cropped.

    bdd

    (@bws-online)

    No matter what I do, I can’t seem to get the image shown on the ad itself NOT to be cropped. If you select it, it shows the image at the full size in the lightbox, but on the ad itself (and on the Preview screen) it’s cutting it off.

    As an example, I was working with an image that was 650×650. I tried revising the Adverts Options to the same max-width and max-height for each option (so Adverts Gallery 650×650, Adverts List 310×310, Upload Thumbnail 150×150), but that didn’t help.

    What’s being shown in the wpadverts-slide div is 750×350, grabbed from the center of the image so it’s cutting off the top and bottom (as well as stretched a little to get the 650 to show at 750). (Once I click on the image, it opens up in the lightbox and shows the full 650×650.)

    The preview for the ad (before it’s sent to moderation) is showing the image at 1140×350 — so taking the 650×650, stretching it out to 1140, and also cutting off top and bottom.

    Ideally, I’d like it more clear what the best image size is to use for it to fit cleanly in all slots.

    If there were a way to have it grab the image shown on the preview and on the ad itself from the top (rather than the middle), that would be one way toward making this at least a little better/usable.

    Plugin Author Greg Winiarski

    (@gwin)

    1. the width of the slider depends on your theme only, specifically from the content section when the gallery is visible.

    2. you can deregister the image sizes set for the slider by WPAdverts and register your own with the code below

    
    add_action( "init", function() {
      remove_image_size( "adverts-gallery" );
      //remove_image_size( "adverts-list" );
      //remove_image_size( "adverts-upload-thumbnail" );
    
      add_image_size( "adverts-gallery", 650, 350, array( "center", "top" ) );
    }, 1000 );
    

    it will crop images from top center.

    3. it would be great if you could paste a link to one of the pages with your Ad details page and an image you are trying to upload.

    bdd

    (@bws-online)

    1. I added some CSS to help with this:

    .wpadverts-slides {
    	max-width: 650px;
    }

    2. I added that. It helped some. Thanks. Is that going to override what’s in the Adverts Options section?

    3. It’s a members-only site, can’t post a link for it.

    How about this. Is there any way to resize the image uploaded so that it displays completely in the different spots?

    Or any way to show the user the image as it’s uploaded and let them crop it to the dimensions it’ll be shown at (like that 650×350)?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.