• Resolved JapeNZ

    (@japenz)


    Hi there,

    Is there a function snippet I can use to exclude specific images by ID or class, when I do a bulk resize please?

    I have a few headers that I’d like to skip from being resized as they are wider than my product images.

    Alternatively, and potentially better for my specific usecase, is there a way I can exclude images if they under a specified height?
    This way all current and possible future headers will be skipped, even though they are wider than the Max Width setting.

    Thank you for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support adamewww

    (@adamewww)

    Hi JapeNZ,

    The only options for excluding items are the ones explained in the FAQ, adding -noresize in the name or using the “imsanity_skip_image” filter. You could potentially set those files to read-only and then imsanity wouldn’t be able to do anything with it, but that would probably be a lot of work. Also, as the ID and Class are front-end constructs, and not stored with the image, there wouldn’t be anything that could be done with that.

    Thread Starter JapeNZ

    (@japenz)

    Hi @adamewww,

    Thank you for getting back to me!

    As a workaround I tried just setting the ‘Max Height’ and leaving the ‘Max Width’ at 0… unfortunately it seems that without both values set, the images are blurred in the Woocommerce product page for some reason.

    It’s all good, I’ll manually go through them rather than using the bulk option.

    I’ll just have to remember to add ‘noresize’ when I next update our headers ??

    Is there a guide anywhere on how to use the “imsanity_skip_image” filter?

    Thanks for your help!

    Plugin Support adamewww

    (@adamewww)

    There isn’t a guide on using that, however Shane does have a write-up on using filters in general (using our EWWW plugin for examples): https://ewww.io/2016/03/16/ewww-image-optimizer-filters-part-1/

    The first option is to set it to true and the second option would be the filename.

    Plugin Support adamewww

    (@adamewww)

    I am going to resolve this thread however feel free to open a new one if you have further questions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude existing images function’ is closed to new replies.