How can I force a specific image to feature when sharing my links on Facebook?

Follow

Comments

6 comments

  • Avatar
    Santosh

    images are not loading on facebook when we share can you please take a look

    0
    Comment actions Permalink
  • Avatar
    Roee Ben Ari

    Can you please share a couple of examples that demonstrate your issue? if you want to keep it private, please feel free to open a support ticket with all the necessary details.

    0
    Comment actions Permalink
  • Avatar
    Santosh

    @Roee created seperate ticket

    0
    Comment actions Permalink
  • Avatar
    Mirha Masala

    I have the following code in Rails. Unfortunately, the width attribute doesn't seem to be taking.

    ```
    <% content_for :meta_image, cl_image_path(@recipe.photo.key, width: 1200, quality: "auto") if @recipe.photo.attached? %>

    ```

    What am I missing?

    0
    Comment actions Permalink
  • Avatar
    Aleksandar Kostadinov

    Hi Mirha,

    The width parameter is not being reflected in the URL since width/height relies on another parameter being present - "crop" - which controls what type of cropping to apply. You could try to set - crop: "scale" - in your cl_image_path and that will use the "scale" mode and the width and crop mode parameters would be added to the URL.

    Please see the below section in the documentation that provides more details on the different crop modes available so that you can find the best one for your requirements (as it may not be "scale" which was just an example) -

    https://cloudinary.com/documentation/image_transformation_reference#crop_parameter

    0
    Comment actions Permalink
  • Avatar
    Mirha Masala

    Oh, got it! That makes sense. Thank you. 🙂

    0
    Comment actions Permalink

Please sign in to leave a comment.