• Resolved Generosus

    (@generosus)


    Good Day,

    We are currently lazy loading our images using the plugin, Perfmatters. It works great and offers several lazy loading features that your plugin doesn’t. However, it does not offer a “Scale Images” feature.

    Based on the above, we’d like to use your plugin’s feature, “Scale images and Lazy load,” but without the “Lazy load” part.

    Details: https://prnt.sc/632FVJWaQBeQ

    Is there a code snippet we can use to disable your plugin’s “Lazy Loading” feature but retain the “Scale Images” part?

    Better yet, would it be possible to update your plugin’s settings to offer “Scale Images” and “Lazy Loading” separately?

    Thank you ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author optimole

    (@optimole)

    Hi,

    This is not tehnically possible right now as we need to get the right size before the lazyload.

    Would be curious why you want to not use our lazyload, is something that dont work right ?

    Thanks!

    Thread Starter Generosus

    (@generosus)

    Hi @optimole,

    Thanks for the quick reply. Each website is different.

    In our case, Perfmatters offers lazy loading features and filters that your plugin doesn’t. For example, it offers “fade-in” effects and several filters that allow us to disable lazy loading by page type (post, events, etc.).

    As stated before, we’d like to scale our images using your plugin, but retain the lazy loading features of Perfmatters.

    So, why can’t you separate image scaling from lazy loading? Using two (2) toggles (one for scaling images and one for lazy loading) should help many by offering a higher level of customization.

    If the above is not possible, oh well, we tried. ??

    Thread Starter Generosus

    (@generosus)

    Good Day,

    Can you guys provide an update on this? Any workarounds? (e.g., disable lazy loading programatically via PHP code snippet, etc.).

    This is critical for us since we like the way your plugin converts the images (without lazy loading).

    Thank you!

    Plugin Support Kush

    (@kushnamdev)

    Hi @generosus,

    Unfortunately, it is currently not possible to scale images without using the Optimole lazy loading mechanism as it is dependent on lazy loading.

    Best regards

    Thread Starter Generosus

    (@generosus)

    Thank you, Kush. As an alternative, can you guys develop/provide a filter (e.g., php code snippet) that would allow us to exclude certain images from lazy loading? Again, thank you.

    Thread Starter Generosus

    (@generosus)

    Update:

    (1) We found this filter (shown below) to disable an image from lazy loading. How can we modify it to exclude several images?

    add_filter('optml_dont_replace_url', function( $old, $url ) {
         if ( $url === 'https://example.com/wp-content/uploads/2018/09/1.jpg' ) {         
             return true;    
         }    
         return $old;  
    }, 10, 2);

    (2) We also found this filter (shown below) to disable lazy loading of PNG images. Can you guys kindly provde one to disable JPEG images?

    define("OPTML_DISABLE_PNG_LAZYLOAD",true);

    Thank you!

    Plugin Support irinelenache

    (@irinelenache)

    Hello @generosus,

    You can use the built-in exclude mechanism in order to exclude images from optimizing/lazy-loading, using several conditions, without needing to add any filter, as you can see here: https://docs.optimole.com/article/1191-exclude-from-optimizing-or-lazy-loading

    If you encounter any issue, don’t hesitate to open another support topic.

    Best regards,

    Irinel

    Thread Starter Generosus

    (@generosus)

    Hey Irinel,

    Your answer does not address our questions. Can you kindly revisit them?

    Thank you!

    Plugin Support irinelenache

    (@irinelenache)

    Hello @generosus,

    I’m sorry about not answering the questions.

    Currently, we do not offer other filters than the ones present in the Optimole documentation, and that’s why I redirected you to the built-in feature.

    I hope this helps,

    Irinel

    Thread Starter Generosus

    (@generosus)

    Hey @irinelenache,

    Can you kindly approach your developers to see if they can answer the questions?

    The first question simply requires telling us how we can use your filter for several images at a time (standard PHP coding).

    The second question, simply requires including jpg/jpeg images in your code (adding the image format to the code).

    Without updating your plugin or documentation, providing the requested info via reply would be good enough for us.

    Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Request | Scale Images Without Lazy Load’ is closed to new replies.