jekyll_picture_tag icon indicating copy to clipboard operation
jekyll_picture_tag copied to clipboard

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

Open Dabako opened this issue 2 years ago • 4 comments

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.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

log.txt

Dabako avatar Jun 25 '22 21:06 Dabako

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?

rbuchberger avatar Jun 27 '22 08:06 rbuchberger

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

Dabako avatar Jun 28 '22 16:06 Dabako

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?

erikw avatar Jul 31 '22 13:07 erikw

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

brandonhundt avatar Aug 11 '22 19:08 brandonhundt

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

YJPL avatar Aug 15 '22 16:08 YJPL

Status update:

  • The offending code is part of a format check ironically meant to make things more user-friendly. It checks which formats vips supports before trying to convert images, so we can have a friendlier error message. (Without this check, we get a really unhelpful error message pointing deep within JPT when trying to convert unsupported formats)
  • Apparently the vips cli has changed the way to check supported formats. For older versions it's foreignsave, for newer versions it's save.
  • We still need to support old versions, so I can't just change the check to save

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 avatar Aug 16 '22 11:08 rbuchberger

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

rbuchberger avatar Aug 16 '22 12:08 rbuchberger

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

YJPL avatar Aug 16 '22 13:08 YJPL

I can also confirm that it works, thank you!

erikw avatar Aug 16 '22 13:08 erikw