Support » Plugin: Recipe Cards For Your Food Blog from Zip Recipes » Multiple Image Formats

  • Resolved plexusllc

    (@plexusllc)


    Google recipe cards in search crops the recipe image to 1:1 for desktop / laptop devices and 16:9 for mobile devices.

    After carefully optimizing all our recipe images in 1:1 format, discovering that the images looked pretty poor in some cases in mobile browsers was frustrating.

    I looked at the updated Google Recipe JSON-LD specifications (https://developers.google.com/search/docs/data-types/recipe) and it turns out that they have a new spec for images that would allow you to specify different image files for different image formats.

    The image node of the JSON now looks like this:

    "image": [
      "https://example.com/photos/1x1/photo.jpg",
      "https://example.com/photos/4x3/photo.jpg",
      "https://example.com/photos/16x9/photo.jpg"
      ],

    I would like to be able to specify all three of those formats for our recipe images so that the recipe cards will look attractive in search results for both desktop and mobile devices.

    Is this something that you are open to developing for Zip Recipes?

Viewing 6 replies - 16 through 21 (of 21 total)
  • You are right about the javascript. I just did a cache-clearing (shift-cmd-R) reload on the page and that fixed the “clear images” problem.

    I can regenerate thumbnails but I’ve been reluctant to do it because there are thousands of images on this site and it will take a long time and eat a lot of CPU to do it.

    The existing image that is failing is definitely 475×475 px and exists as such in the media library and on the server’s filesystem. It seems odd that the validation won’t allow choosing this image.

    Plugin Author RogierLankhorst

    (@rogierlankhorst)

    It doesn’t accept it, because this image doesn’t have the specified size generated. If you download it to your computer, then upload it through the media library, the size will be generated and it should work.

    Because the image is already there, WordPress doesn’t generate the required size.

    Hey @rogierlankhorst thanks very much for your great work on getting this new feature shipped and also for fixing the image saving issue. Excellent job.

    Plugin Author RogierLankhorst

    (@rogierlankhorst)

    @plexusllc thanks 🙂

    Hi again @rogierlankhorst, I just noticed a little typo in class.ziprecipes.php on line 171.

    The line looks like:

    add_image_size( 'zrdn_recipe_image_json_4x3_s', 164, 198, true);

    But it should be:

    add_image_size( 'zrdn_recipe_image_json_4x3_s', 198, 164, true);

    The long and short dimensions were reversed somehow. The larger 4×3 thumbnails above that in the class file are correct.

    Plugin Author RogierLankhorst

    (@rogierlankhorst)

    Yes! You’re right, I’ve corrected this, will update it by the end of the week.

    Thanks for reporting it!

Viewing 6 replies - 16 through 21 (of 21 total)
  • You must be logged in to reply to this topic.