vips-ffm icon indicating copy to clipboard operation
vips-ffm copied to clipboard

AVIF support deprecation

Open abe-frickelbude opened this issue 7 months ago • 2 comments

Hello! First of all, allow me to offer my sincere compliments on your excellent library! I've been looking for modern Java bindings for libvips for a while now, and your project is the first library I've come across that is feature-complete and user-friendly!

I do have one small question: why is the VImage.avifsaveTarget() method slated for deprecation and/or removal? Do you intend to e.g. restructure the API design in the near future?

I'm referring to lines 724-727 in the VImage class implementation.

It wouldn't be difficult to create a local implementation in a project that requires this, using your existing APIs, but it would be very useful to know if there is some deeper, underlying reason :-)

Thank you in advance!

With best regards, Abe

abe-frickelbude avatar May 19 '25 14:05 abe-frickelbude

Hey Abe - thanks for the kind words about the library 🙂

All the code in that file is automatically generated from the libvips API, and that function is marked in libvips as deprecated for removal. I'm having a hard time finding it on the libvips docs website though, so I'm not entirely sure why - it's likely that there's another method for doing what you want to do.

You might be able to get a better answer over at the discussions bit of the libvips project: https://github.com/libvips/libvips/discussions

lopcode avatar May 20 '25 01:05 lopcode

Hi :-) Thank you for your quick reply - I appreciate it! I will go ahead and follow this up on the official libvips discussions forum as you suggested - I have a vague theory that this function might have been deprecated in favor of directly using vips_foreign_find_save() / save_target(), as e.g. utilized in your VImage.saveToStream() method, or maybe a similar reason.

Sincerely, Abe

abe-frickelbude avatar May 22 '25 08:05 abe-frickelbude

Hello, avifsave_target isn't really deprecated, it's just hidden from downstream bindings. It's an internal class used to implement automatic AVIF format selection from the suffix.

In Python (for example), you're supposed to write:

image.write_to_target(target, ".avif")

When generating code and docs, I would not emit anything for deprecated arguments or operations.

jcupitt avatar Jun 10 '25 13:06 jcupitt

Thanks - I'll make an issue to fix this up and hide these methods

lopcode avatar Jun 11 '25 15:06 lopcode

I've released the hiding of these methods in 1.7.0, so closing this issue: https://github.com/lopcode/vips-ffm/releases/tag/v1.7.0

lopcode avatar Jun 13 '25 23:06 lopcode

Nice! It should make the API look a little simpler too.

jcupitt avatar Jun 14 '25 15:06 jcupitt