• Resolved doomidze

    (@doomidze)


    Hello. I set the custom thumbnail size for my images but not shows right size http://prntscr.com/rm39jx . It added only inline styles. I need to show images with less size (292×140). I receiving right sizes only with removing ‘scan_images’ parameter, but I’m not sure that it is good idea http://prntscr.com/rm3for . Also I’m adding ‘thumb_size’ and add_image_size($size) but without success.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Ajay

    (@ajay)

    Few things to check:
    1. What is the settings page for CRP have for the thumbnail size and have you activated the crop settings and also the crp_thumbnail?

    2. You can try installing https://ww.wp.xz.cn/plugins/otf-regenerate-thumbnails/ This hasn’t been updated for a while but has worked with the last few versions.
    Alternatively just regenerate all thumbnails with https://ww.wp.xz.cn/plugins/regenerate-thumbnails/

    3. Can you check that the thumbnails actually exist?

    Thread Starter doomidze

    (@doomidze)

    I tried to fix it and even when I removing ‘scan_images’ parameter – it is not working (still large images)
    I activated the crop settings – not working
    I created new media size https://prnt.sc/rmtd7u, tried with cropping and without – not working.
    I’m using Regenerate Thumbnails plugin and it creates needed size of images https://prnt.sc/rmtfte

    Plugin Author Ajay

    (@ajay)

    Could you please turn on crop mode as well in your settings so the exact image size gets created?

    The rest of the settings look fine.

    And looks like your images are also there properly. Do you also have the image from https://prnt.sc/rm39jx created in the size?

    Thread Starter doomidze

    (@doomidze)

    Still no
    https://prnt.sc/rn4xjp – crop mode
    https://prnt.sc/rn4zrx – image
    https://prnt.sc/rn4w8k – result
    https://prnt.sc/rn55t4
    $output .= zerif_list_link( $args, $result );
    Other settings works fine

    • This reply was modified 6 years, 2 months ago by doomidze.
    • This reply was modified 6 years, 2 months ago by doomidze.
    Plugin Author Ajay

    (@ajay)

    What is the function “zerif_list_link”? Is this being bundled into Zerif? And, if so is this the latest version?

    If not, can you disable whatever is via Zerif and instead use the latest version of Contextual Related Posts repository?

    I’m not sure if this is an issue but want to eliminate if that is the case.

    I think there might be a bit of debugging needed as I’m quite lost as to why.

    Looking at that specific image, this is being pulled up because the “scan images” which is the same as the Extract First Image setting (in your screenshot above) is enabled.

    This is the piece of code: https://github.com/WebberZone/contextual-related-posts/blob/v2.8.0/includes/media.php#L113-L142

    The plugin first extracts the image and then attempts to get the correct size

    This looks like it needs a lot more debugging, but two things as a workaround – you can use a featured image when saving the posts which will automatically use that first vs trying to extract an image.
    The other option is to disable uncheck the setting to extract the first image

    Plugin Author Ajay

    (@ajay)

    I’ve been doing more testing with this and I realised the reason why this is likely not working and involves the way the plugin tries to guess the correct size when it extracts the first image in the post.

    This line attempts to find the ID of the image/attachment and then find the correct size. Looking at your screenshot, the image has a relative link starting with / instead of your full image URL including your domain. As a result of this, it cannot find the image ID and consequently can’t find the correct size for the image.

    One way to try to fix that is to use the full image URL including your domain – although the featured image approach will be the better option as per my previous post.

    Thread Starter doomidze

    (@doomidze)

    Thank you for your answer Ajay.
    Yeah, I can imagine the problem.
    My custom output for image now is a crp_list_link function. I don’t know how I can replace an image. Without my custom output works well.

    I can delete my output but I need to customize my output. Just replace the structure: wrap an image in new div, replace title, add a permalink to title.
    I saw the api file https://github.com/WebberZone/code-library/blob/master/contextual-related-posts/crp-api-example.php but I can’t figure out how to solve my problem. Only replacing will be enough.

    Plugin Author Ajay

    (@ajay)

    I’ve made some changes to the way the plugin looks at thumbnails, including some extra checks – but I’m not sure if this fixes your problem. Have you had a chance to test with v2.9.2?

    I don’t think using the API to get your own custom output would help – it might be easier to disable “Get first image” in Thumbnail settings and see what the outputs are.

    Thread Starter doomidze

    (@doomidze)

    I’m using Version 2.9.2
    With disabling “Get first image” works well but I really need “Get first image” because I have many posts with it.

    Plugin Author Ajay

    (@ajay)

    I’m not sure how exactly to get this dynamic given the relative paths which doesn’t allow the plugin to find the right size.

    Two options I can think of given your install:
    1. https://hexadix.com/wordpress-auto-set-featured-image-using-first-image-post/ set the first image as a featured image

    2. Do a find and replace in the DB to replace your partial URLs "/ with your example.com/ so that the plugin can attempt to trace this. Obviously, please only use this on a test install and sufficiently backup

    Thread Starter doomidze

    (@doomidze)

    Thank you Ajay.
    Unfotunatelly I haven’t PayPal to buy you a cofee

    Plugin Author Ajay

    (@ajay)

    No problem at all! Thank you for the review.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Size images’ is closed to new replies.