WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] How to stop YAARP creating thumbnails (18 posts)

  1. telwp
    Member
    Posted 1 year ago #

    It's taken me 2 hours to crawling through a heavily modified WP install to find what bit of code was generating thumbnails in my uploads folder when I added a new featured image to a post.

    YAARP is the culprit!

    I'd like to turn this 'feature' off, I don't want my uploads folder filled with odd sized thumbnails that are never used.

    1. How can I stop YAARP doing this without hacking the core files?

    2. Out of curiosity, why does this plugin have a thumbnail generator? Can it not use the ones created by WP? Just wondering!

    Thanks.

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. fert
    Member
    Posted 1 year ago #

    I, too, am interested in this. My installtion is set to use 200x133 images as thumbnails, but YARPP uses 12x12 anyway (I use the thumbnails option). Since I want them to be displayed in 200x133, they get stretched...

  3. telwp
    Member
    Posted 1 year ago #

    I guess I should add that I use the Custom display option in YAARP settings and a basic custom template, in case any thumb option gets added in the future. I just don't want it creating thumbs itself!

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry to hear that it was creating thumbnails without your awareness! YARPP does *not* generate thumbnails on the fly for its "thumbnail" feature... this must be some interaction with some other plugins.

    All of these issues are addressed in the readme. Look at the first two items in the FAQ section. That'll tell you how to set the thumbnail size used by YARPP, as well as tell you how to control whether thumbnails are automatically generated or not (the default is no).

  5. telwp
    Member
    Posted 1 year ago #

    Hi mitcho, not sure why you marked this as resolved, the problem still exists.

    For what it's worth, YAARP certainly IS creating a thumbnail on my install, can you explain how an interaction with another plugin would make YAARP create a cropped thumbnail? Surely the process trigger is only within the confines of the YAARP code?

    The default YAARP thumbnail crop size appears to be 120x120.

    I did this quick test to give a step-by-step:
    I activate v4.0.4
    Click Add New Page
    Then Set Featured Image
    Upload a 750 x 550 PNG image (bg.png)
    My uploads folder now has the original image plus a "bg-120x120.png"

    If I deactivate v4.0.4, repeat adding new page/image, no 120x120 image is created.

    I then tried add_image_size to change the sizing to 130 x 130.

    Same process above, this time bg-130x130.png was auto-generated.

    Can you please give an option to completely ignore all thumbnail related code in YAARP?

    Thanks

  6. telwp
    Member
    Posted 1 year ago #

    Hi again mitcho, I just had a play around with class-core.php and found that by commenting out the following code I no longer had the 120x120 cropped images being created.

    // register yarpp-thumbnail size, if theme has not already
    		// @todo: make these UI-configurable?
    		if ( !($dimensions = $this->thumbnail_dimensions()) || isset($dimensions['_default']) ) {
    			$width = 120;
    			$height = 120;
    			$crop = true;
    			add_image_size( 'yarpp-thumbnail', $width, $height, $crop );
    		}

    For now, I'll leave it commented out but I hope that helps you in some way if this issue is more widespread than just me.

    Cheers, fantastic plugin overall, great work.

  7. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm, editing the files in YARPP itself will mean that your changes will get overwritten on a YARPP update.

    Let me think about this. I may add a hook in a future version to turn off all thumbnail handling code.

  8. benoa
    Member
    Posted 1 year ago #

    So YARRP was the culprit ? I wasted a whole morning trying to figure out why WP kept on generating those 120x120 thumbnails always :(

  9. Drbappaditya Mishra
    Member
    Posted 1 year ago #

    Yarpp generates 120*120 thumbnails every time I upload images...

    Very annoying...

    Pls @Mitcho resolves this issues...

    However thanks for this excellent plug in......

  10. jaegerschnitzel
    Member
    Posted 1 year ago #

    With the latest version 4.0.5 YARPP ist still producing this 120x120 thumbnails. Can you deactivate that in the future versions please?

    Until you can do this I have a solution for this problem. Just paste this code in your functions.php:

    function senaeh_only_add_medium_size( $sizes) {
    	unset( $sizes['yarpp-thumbnail'] );
        return $sizes;
    }
    add_filter('intermediate_image_sizes_advanced', 'senaeh_only_add_medium_size');
  11. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Hi all,

    Thank you all for your feedback. I gave this some thinking, and I think I've come up with a solution right in YARPP which deals with this well. This is in the latest beta, 4.0.6b4, which I invite you to try:

    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.4.0.6b4.zip

    The design is as follows: the yarpp-thumbnail image size will be registered (which will trigger generation of those thumbnails)...

    1. if you are automatically displaying using the thumbnails view on your site or in your RSS feeds;
    OR
    2. if you've called YARPP with the thumbnail view some other way (via the widget or via code) before.

    The (2) situation notices that this has happened and flips a switch internally, so it knows that thumbnails should be built, even though (1) is not the case. This switch can be changed manually using the YARPP Experiments advanced supplemental plugin.

    For 99% of users, I believe this logic above will strike a good balance between (a) not creating thumbnails if they're not necessary (the issue in this thread) and (b) making sure thumbnails of the right size are generated if the site wants to use them.

    Please let me know what you think! :) I hope to release this update as 4.0.6 soon, assuming that you guys don't find some bugs. :)

  12. jaegerschnitzel
    Member
    Posted 1 year ago #

    Thanks for your fast reply. In my case the new beta version works fine. It notices that I don't use thumbnails (1.) and does not create them anymore.

  13. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Fantastic!

  14. fert
    Member
    Posted 1 year ago #

    Thanks a lot for changing this.

    I am not entirely sure if this is really working, it is a bug or it is just a legacy artifact.

    If you take a look at this article:
    http://www.urgeschmack.de/mit-elefantengang-und-skorpion-zum-knackigen-bauch-urgeschmack-tv-ep-143/

    You can see the three YARPP icons at the bottom. The first two of those are somehow rescaled. The Plugin picks the 120x120 sized thumbnails and rescales them to a width of 190px (which I am telling it to do via CSS). Of course that looks bad because it is basing this on the self-generated 120x120px image instead of the actual featured image.

    I am using version 4.0.6 of YARPP with the "Thumbnail" setting. Or does this setting NOT refer to the article featured image?

    Stranger still is the fact that YARPP choses to pick the correct sized image for the third related link, using the 300x200px image and displaying a downscaled version of it.

    And what confuses me even more is that the html code it uses says 'width="120" height="80"' which is not what is displayed.

    Could you explain that? Is there anything I can change to fix this?

  15. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    @felixo I think this is an artifact of some images being uploaded when certain settings were in effect, and others at another time.

    What you want to do is to run the "Rebuild Thumbnails" plugin and let it run through and make all the appropriate thumbnails.

  16. fert
    Member
    Posted 1 year ago #

    Good idea. When I start "Ajax Thumbnail Rebuild", though, it still lists

    yarpp-thumbnail (120x120 cropped)

    So I went and changed the width to 190 in the class-core.php (which does not feel right because it will be overwritten by future updates).

    That did the trick. Thanks a lot for your advice!

    Is there a way to maintain this change throughout future versions?

  17. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Odd. Which plugin are you using for the thumbnail rebuilding?

  18. fert
    Member
    Posted 1 year ago #

    I am using AJAX Thumbnail Rebuild 1.08 by junkcoder:

    https://www.breiti.cc/wordpress/ajax-thumbnail-rebuild/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags