• Resolved Jek-fdrv

    (@jek-fdrv)


    Hi there, i use very custom build, and i create the src set list of images my self via php. I would like to use your nice plugin to control when and how to resize, generate webp image and if it should has lazy load or not my self in php. Example:

    In the page tempalte:
    get_right_image($image_id, '300px');

    In functions.php

    function get_right_image($image_id, $size) {
      $popular_device_sizes = [1440, 921, 769, 390];
      foreach($popular_device_sizes as $img_size) {
        $srcst[] = generate_ShortPixel($image_id, $img_size);
      }
      return '
      <img src="'.$srcst[0]['src'].'" 
    	srcset="'.implode(', ', $srcst).'" >';
    }

    So do you have a function some like generate_ShortPixel ?

    This is only very roughly code example, not the real one.

    • This topic was modified 2 years, 3 months ago by Jek-fdrv.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    That’s an interesting question, but since I don’t know what generate_ShortPixel() does, it’s not possible for me to answer whether we have a function like it ??

    Presumably, it returns a URL? But what exactly does it do?

    Thread Starter Jek-fdrv

    (@jek-fdrv)

    Like I said this is a code example.
    So i am preaty sure you dont have generate_ShortPixel.
    In the code example i try to show what kind of functionaly we need on our website with your plugin.

    Plugin Author nosilver4u

    (@nosilver4u)

    That may very well be that we don’t have a function which matches generate_ShortPixel(), but I’m not certain since we still don’t even know exactly what it does.

    From the code you posted, it seems you need a function that will give you a URL for a given attachment ID and width in pixels, and that we do have via our Easy IO CDN. But that’s a paid service and not suitable for discussion in the free wp.org forums, so if you’re interested please contact us here: https://ewww.io/contact-us/

    Thread Starter Jek-fdrv

    (@jek-fdrv)

    Actually no.
    I just need function which will generate additional versionn of the original uploaded image with smaller size.
    For example use upload image 4000 on 4000 pixels. And i will need to resize it to 1920 on auto (keep original image ratio), and then i also would like to compress it.

    Plugin Author nosilver4u

    (@nosilver4u)

    I guess I wasn’t clear, but that’s basically what I meant, except our Easy IO service generates those on a CDN, so that you’re not using any storage for those smaller images. It’ll also be compressed, and potentially converted to WebP (unless you don’t want that, then you can turn off WebP conversion).

    Thread Starter Jek-fdrv

    (@jek-fdrv)

    I use WPEngine which already has cdn and storage. Can i still use your plugin?

    Plugin Author nosilver4u

    (@nosilver4u)

    So do we ??
    If you’re using their older CDN, you’d swap that out for Easy IO, otherwise with their newer Advanced Network (which uses Cloudflare), it’d go “on top” of that.
    Easy IO is a pull-mode (on demand) CDN, so it doesn’t take the place of your existing/local images on WPE, like if you were using S3, GCS, etc. It can work with all of those also.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I would like to generate different image size via php.’ is closed to new replies.