AVIF format not work correctlty with the img_url filter

Short description of issue

If you upload an image in “avif” format and use the “img_url” filter in the code to display the image, the image will be displayed in low quality, ignoring the parameters for specifying the width or height of the image.

Reproduction steps

  1. Upload an image in the “avif” format in the theme customizer to the “image_picker” setting.
  2. Render this image using “img_url” filter.
  3. Check this image on the website - it will be of very low quality.

Additional info

If you upload the image in a jpeg, webp format, everything will work fine.

What type of topic is this

Bug report

Hey @UTD-Dev

Do you get the same result when using the image_url [1] and image_tag [2] filters?
These have replaced img_url and img_tag, respectively.

{{ product.featured_image | image_url: width: '1800' | image_tag }} for example should work as expected.

Hey @Arthur_Demurger !

With the new filter image_url , the image is displayed correctly.

In our new themes, we use the image_url filter and everything works fine.

But we have an old theme that uses the old img_url filter (the new image_url filter didn’t exist back then).

I understand that one can be replaced with the other. But nowhere in the documentation does it say that the old filter does not work/cannot be used or that it has problems displaying AVIF images. After all, the old filter is available and works for backward compatibility.

Could you please check if it is possible to fix the display of AVIF images for the old img_url filter?

Right now, it looks like a bug.

Up. Can someone check this and tell me if it can be fixed?

@Arthur_Demurger Hello :slightly_smiling_face:
Could you please respond to my current request? Thank you for your attention.

Is anyone from Shopify stuff can help with this please?

Say clearly: no, we won’t fix this. Or yes, we’ll look into it in the future.

@Paige-Shopify Hello! Can you please check this?

If this isn’t going to change, please let me know and close (or I will) this thread.
Thanks!

Hi @UTD-Dev, for Liquid filters we’ve marked as deprecated, we don’t typically prioritize fixes unless the impact is significant, for example if all image formats are affected. This is especially the case when there’s a newer alternative available where the issue doesn’t occur.

That said, I’ll check whether we can prioritize this and follow up with you.

1 Like

@UTD-Dev We’ve determined that we’ll look into addressing this in the future, but it’s currently a low priority, so it’s unlikely to be addressed in the near term. Once we’ve shipped a fix, we’ll provide an update here.

1 Like

Hi Paige-Shopify! Thanks for the your answer!

Have a nice day :slightly_smiling_face:

1 Like