-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ForeignPngFilter #106
ForeignPngFilter #106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added a few inline suggestions, but otherwise this looks good to me! The reason that this "enum" was not semi-generated is because VipsForeignPngFilter
is not an enum, but a bit field.
@jcupitt Do you think the other bindings can also benefit from this? I had a similar issue with wasm-vips, see for example:
https://github.com/kleisauke/pyvips/tree/flags-helper
https://github.com/kleisauke/wasm-vips/blob/master/build/gen_type_declarations.py#L228-L230
https://github.com/kleisauke/wasm-vips/blob/master/build/gen_type_declarations.py#L251-L253
https://github.com/kleisauke/wasm-vips/blob/master/build/gen_type_declarations.py#L283
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
Yes, the flags/enum thing is used in some places, but not worked through all the bindings. It might be useful to fix this. |
Thank you Randy, this will be in v1.2.5. @jcupitt As far as I know |
There are a few unimportant ones, eg.:
gtk-doc uses the magic I wonder if |
I'll also add the corresponding var im = Image.NewFromFile("lichtenstein.jpg", access: Enums.Access.Sequential);
im.Pngsave("lichtenstein.png", filter: /*(int)*/Enums.ForeignPngFilter.All); (it currently requires casting an |
@jcupitt I'm not not entirely sure if you could do |
I can confirm that $ pngcheck -vv lichtenstein.png | grep filters -A 1 | tail -5
row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth):
3 4 4 4 4 4 4 (2415 out of 2421)
--
row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth):
4 3 4 4 4 4 (2421 out of 2421) |
Huh how curious. Thanks for checking. |
NetVips v2.0.0 is now available with this improvement included. |
add ForeignPngFilter