Closed d9beuD closed 8 months ago
Thanks @d9beuD. Happy to accept a pull request to fix this if you have the time. Probably just a case of adding .webp to the list of acceptable file extensions, as ImageMagick already supports the format I believe.
What do you think about checking the mime type of the file instead of the extension? I don't know Ruby enough to say if it's doable, but:
if File.exist?(src) and File.mime?(src, "image/*)
instead of the line I quoted in my original comment. If you're okay with this idea, assign me to the issue and I'll try my best to make it work.
Nice idea if you can get it working @d9beuD. That should open up support for any image formats that ImageMagick supports. Assigned you the ticket, thanks for the contributions!
Say I use the filter like
{{ "/assets/img/test.png" | size: 480 }}
then it outputs/assets/img/test-480w.png
. But if the file istest.webp
it outputs/assets/img/
without the file name.I think it's because of the following line, but the
srcset
function has it too, yet it works.https://github.com/lawmurray/jekyll-responsive-magick/blob/4f809ea4a0629f7ea728bb26629498446397479b/lib/jekyll-responsive-magick.rb#L145