Code Monkey home page Code Monkey logo

Comments (5)

gchtr avatar gchtr commented on June 2, 2024

Hey @cyrillbolliger

Yeah, I ran into the same issue. The issue is not only that there’s no large image size, it’s also that Yoast grabs the data from the metadata of an image, which is usually saved in the database.

With Timmy v14.0, Timmy will generate that image metadata just like it would for default WordPress images. So, to make it work, you have to:

  1. Define a large image size in your image configuration for Timmy.

    'large' => array(
        'resize'     => array( 1400 ),
        'show_in_ui' => false,
    ),
  2. Run Regenerate Thumbnails to generate the image metadata for the database.

from timmy.

cyrillbolliger avatar cyrillbolliger commented on June 2, 2024

Hi @gchtr

Thanks for your lightning fast response. I just tested your proposed solution: It works if I regenerate the thumbnail. However if I upload a new image, it doesn't solve the problem. I still have to regenerate the thumbnail after uploading a new image in order to get it working.

Grüess uf Winti ;)

from timmy.

cyrillbolliger avatar cyrillbolliger commented on June 2, 2024

Hi @gchtr

I found a workaround meanwhile, I'll post it here in case it helps someone else. It basically just adds the size 'large' again:

add_filter( 'intermediate_image_sizes_advanced', function ( $metadata ) {
	$metadata['large'] = array(
		'width'  => 1200, // some value that comforts facebook etc.
		'height' => 0,
		'crop'   => false,
	);
	
	return $metadata;
}, 11 );

from timmy.

gchtr avatar gchtr commented on June 2, 2024

Hey @cyrillbolliger

That’s a cool little workaround! Small note for myself and others: Using the intermediate_image_sizes_advanced will use the default WordPress image resizing functionality instead of Timmy’s.

However if I upload a new image, it doesn't solve the problem. I still have to regenerate the thumbnail after uploading a new image in order to get it working.

That’s strange! I just tested it, and when I drop an image in the Media menu in the backend, the meta data is generated.

Timmy returns an empty array for intermediate_image_sizes_advanced to prevent running the default image generation of WordPress. This is for performance reasons. That filter is called in wp_generate_attachment_metadata(), which later also calls the wp_generate_attachment_metadata filter, where Timmy builds up the sizes array for the meta data.

So I have two questions for you:

  1. Where do you upload the image?
  2. Can you check whether another plugin might interfere by disabling all other plugins and try it again?

Thinking of this, I could probably use the wp_get_attachment_metadata filter to generate the sizes array for the meta data on the fly, if it’s not present 🤔.

Liebi Grüess zrugg nach Bern 🇨🇭🙌

from timmy.

cyrillbolliger avatar cyrillbolliger commented on June 2, 2024

Gosh, I completely forgot this issue, I'm very sorry! As you edited the last response, it reappeared in my feed...

Where do you upload the image?

It works, if I upload the image as content image. However if I upload it in the social section of Yoast SEO metabox as facebook image, it doesn't. Neither if I upload it in the media library (if the Image isn't linked in the content elsewhere).

Can you check whether another plugin might interfere by disabling all other plugins and try it again?

I tried to disable all except ACF and Yoast SEO, but it didn't make a difference.

from timmy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.