• Resolved strarsis

    (@strarsis)


    For the gallery, the image has been cropped for a specific size.
    The gallery image selection doesn’t offer an option for selecting what size should be used and doesn’t preview it either.

    Is it programmatically possible to let it render an image attachment (including srcset and everything) for a specific size?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Navneil Naicker

    (@navzme)

    The usage section of the documentation gives a clue how to get the images of respective size.

    To resize the image to 262px by 160px

    $full_image_url= $image['full_image_url'];
    $full_image_url = acf_photo_gallery_resize_image($full_image_url, 262, 160);

    To resize the image to 150px by 150px

    $full_image_url= $image['full_image_url'];
    $full_image_url = acf_photo_gallery_resize_image($full_image_url, 150, 150);

    To get the uploaded size image without any resize anything
    $full_image_url= $image['full_image_url'];

    How do i get the large image size instead of the full size without giving a specific size? Because not all my images have the same dimension

    Plugin Author Navneil Naicker

    (@navzme)

    @wardari
    Try something like this.
    $large_image = wp_get_attachment_image_src( $image['id'], 'large')[0];

    $image['id'] will give your the attachment id of the image from media library.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use specific image size/crop’ is closed to new replies.