h2non / bimg

Go package for fast high-level image processing powered by libvips C library
https://pkg.go.dev/github.com/h2non/bimg?tab=doc
MIT License
2.68k stars 337 forks source link

pngsave_buffer: no property named `effort` #401

Closed tashaX closed 2 years ago

tashaX commented 2 years ago

It seems that vips 8.10.2 (in fact no version before 8.12 I think ???) doesn't have 'effort' listed in optional arguments for pngsave operation while the latest code passes such argument; inside the vips.h file, vips_pngsave_bridge function :

if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 7)
      int effort = 10 - speed;
      return vips_pngsave_buffer(in, buf, len,
          "strip", INT_TO_GBOOLEAN(strip),
          "compression", compression,
          "interlace", INT_TO_GBOOLEAN(interlace),
          "filter", VIPS_FOREIGN_PNG_FILTER_ALL,
          "palette", INT_TO_GBOOLEAN(palette),
          "Q", quality,
          "effort", effort,
          NULL
      );
gjermundgaraba commented 2 years ago

Yup, got an error related to this. I downgraded bimg from 1.7 to 1.6 and everything works.

The code change related is probably this: https://github.com/h2non/bimg/issues/397 & https://github.com/h2non/bimg/pull/398/files

aksdb commented 2 years ago

In the v2-dev branch this is also fixed. However I bumped the minimum required version of vips to 8.10 (since it's not feasible to test and maintain older versions).

vaibsharma commented 2 years ago

Hi @tashaX, you need to have latest libvips version. This works well on latest 8.12 version. https://github.com/libvips/libvips/blob/master/libvips/foreign/pngsave.c#L551

LatVAlY commented 3 months ago

unfortunately, this issue is still known in version 1.9, downgrading bimg from 1.9 to 1.6 solved the issue