rbuchberger / jekyll_picture_tag

Easy responsive images for Jekyll.
https://rbuchberger.github.io/jekyll_picture_tag/
BSD 3-Clause "New" or "Revised" License
622 stars 106 forks source link

No support for generating avif files in this environment. - Fedora 35 #279

Closed Dabako closed 2 years ago

Dabako commented 2 years ago

Hello,

for some reason I get an error message: ".gem/gems/jekyll_picture_tag-2.0.3/lib/jekyll_picture_tag/parsers/image_backend.rb:11:in `handler_for': No support for generating avif files in this environment. (RuntimeError)"

The first question is if libvips and vips are the same on Fedora? I have all dependencies install, even the tools and devel versions. In the past I could resolve that problem by building vips locally but that does not work for me either now.

_Last metadata expiration check: 0:11:09 ago on Sat 25 Jun 2022 11:02:07 PM CEST. Package vips-devel-8.11.3-6.fc35.x86_64 is already installed.
Package vips-doc-8.11.3-6.fc35.x86_64 is already installed.
Package vips-magick-8.11.3-6.fc35.x86_64 is already installed.
Package vips-openslide-8.11.3-6.fc35.x86_64 is already installed.
Package vips-poppler-8.11.3-6.fc35.x86_64 is already installed.
Package vips-tools-8.11.3-6.fc35.x86_64 is already installed.
Package libheif-1.12.0-3.fc35.x86_64 is already installed.
Package ImageMagick-1:6.9.12.52-1.fc35.x86_64 is already installed.
Package libpng-2:1.6.37-11.fc35.x86_64 is already installed.
Package libwebp-1.2.2-1.fc35.x8664 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

log.txt

rbuchberger commented 2 years ago

Hello!

Digging through fedora packages, I believe libvips and vips are the same. We're also shelling out to the command-line to check format support. Maybe you need vips-tools?

Edit: Missed that it's in your log. Hm.

If that doesn't fix it, could you tell me the output of $ vips -l foreign | grep avif?

Dabako commented 2 years ago

vips-tools is installed.

$ vips -l foreign | grep avif does not show any output. That means, there is no avif support via vips for me? I have install all packages that vips has and also libheif

erikw commented 2 years ago

I have maybe the same problem, but for webp. It used to work all find locally but broke maybe when the local vips version was updated.

I get on jekyll build:

vips: 'filesave' is not the name of a vips class
  Liquid Exception: No support for generating webp files in this environment. 

I'm on macOS 12.5 with vips 8.13.0 from Homebrew. I allso have the Homebrew formula webp 1.2.3 installed which should provide libwebp.

Indeed

$ vips -l filesave
vips: 'filesave' is not the name of a vips class

I'm not sure how it used to work or how it should work, but I did notice that there are a lot of operations under the basename "save" instead. This is probably more general than "filesave", but when I change jekyll_picture_tag to use "save" instead, a bunch of extensions are found (maybe not the right one), but my build passes at least :).

I forked this plugin and made the above change https://github.com/erikw/jekyll_picture_tag/commit/a0b5ef69a885351278e1a9c7fa8b1273eaa7c1c7 and put this instead in my Gemfile:

# gem 'jekyll_picture_tag', '~> 2.0'
gem 'jekyll_picture_tag', github: 'erikw/jekyll_picture_tag', branch: 'master' 

and my site can build again.

I'm not saying this is a proper fix, but at least a temporary workaround for me.

What could the real problem be, should there be a filesave base-name in the most recent versions of vips?

brandonhundt commented 2 years ago

+1 for me. Experienced the same issue. Switching to forked version worked for me.

YJPL commented 2 years ago

Same issue, also with webp— downgrading plugin version is another temporary fix. gem "jekyll_picture_tag", "2.0.0"

rbuchberger commented 2 years ago

Status update:

Shelling out to the command line probably isn't the best way to accomplish this check anyway, for exactly this reason. I'll look into our ruby vips wrapper library to see if it handles this, or else just try one and if it doesn't work try the other.

rbuchberger commented 2 years ago

Just pushed a release; 2.0.4 should fix it. If not please reopen!

YJPL commented 2 years ago

Works locally & deployed in production. Well done, thank you!

erikw commented 2 years ago

I can also confirm that it works, thank you!