imagify-plugin icon indicating copy to clipboard operation
imagify-plugin copied to clipboard

Image name stripped from WebP file if contains non-latin characters

Open markonikolic985 opened this issue 2 years ago • 0 comments

When converting images to WebP, there is a problem with the main image WebP version if image name starts with non-latin characters.

For example, image name is Прием-първи-клас-2оу.png.

Once you optimize it, WebP of the original image will be renamed to -първи-клас-2оу.png while thumbnails' WebP files will be generated properly.

So, it strips all non-latin letters until gets to the first standard character (more precise to say UTF-8 perhaps).

To Reproduce

  1. Upload one of attached files to your WP installation
  2. Optimize it (make sure WebP option is active)
  3. Open the original image in new tab
  4. append .webp to that URL to see if WebP exists - you should get 404 page
  5. remove the first part of non-latin characters from URL and check if WebP is there - you will see WebP

Example of the correct URL for the second attached image (where WebP is visible) will be ...wp-content/uploads/2022/07/HisenseQ5.png.webp

Expected behavior WebP should keep the same name of the image 海信平板HisenseQ5 први-lat

markonikolic985 avatar Jul 28 '22 14:07 markonikolic985