Support » Plugin: Jetpack by » wp_get_attachment_image_src full image issues

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Jeremy Herve


    Jetpack Mechanic

    Could you give me a few examples of the returned Photon URLs?

    If you could give us a link to your site as well, that might be useful!


    Sure, if you look in the <head> section of this page:

    you’ll see

    <meta property="og:image" content="" />
    <meta property="og:image" content="" />

    and no dimensions are returned for either image

    Plugin Contributor Erick Hitter



    The lack of width and height in the data returned by wp_get_attachment_image_src() is a necessary side-effect of using Photon.

    At present, Photon has no way of informing WordPress of the dimensions of an image it resizes. While there are many cases where the size of the image received from Photon matches the requested size, there are also cases when this won’t be true. This depends largely on the size of the original image and whether or not the image size dictates cropping be applied.

    As a result, the module sets WordPress’ image functions to return false when an image is processed with Photon. This avoids image skewing and prevents WordPress from returning misinformation about the resized image.

    Hope this helps explain what’s happening with wp_get_attachment_image_src().

    As for the resizing parameters on the og:image meta tag, that problem should’ve been fixed in Jetpack 2.2. We’ll investigate why that isn’t working properly and update this thread once it is fixed in Jetpack.

    ok thanks for the info. Is there a simple way to use wp_get_attachment_image_src() without using photon? I.e. I could use it once (without photon) to grab the image dimensions from the local full-size image, and then again (with photon) to actually grab the image url?

    Edit: Never mind, I see you’ve answered this on my other thread!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_get_attachment_image_src full image issues’ is closed to new replies.