Skip to content
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

Use enumerations for ease of use #112

Closed
HolyOne opened this issue Jan 14, 2021 · 2 comments
Closed

Use enumerations for ease of use #112

HolyOne opened this issue Jan 14, 2021 · 2 comments
Labels
api-breaker Breaking API changes enhancement New feature or request
Milestone

Comments

@HolyOne
Copy link

HolyOne commented Jan 14, 2021

Hello,
I see that i have to input some string values as parameters which makes me go search a lot of documentation.
for example

NetVips.Image.Thumbnail(path, w, h, crop: "attention"))
Why not use

public enum CropParameters { attention , someotheroption, ... }

@kleisauke kleisauke added api-breaker Breaking API changes enhancement New feature or request labels Jan 28, 2021
@kleisauke
Copy link
Owner

The reason for this was that passing strings was more dynamic (and maintainable), since there is no need to release a new NetVips version every time a new enumeration is added within libvips.

But I agree, I think using enumerations instead of strings makes more sense. I had an attempt to implement this, see commit 19486a7 on the enum branch. If you want to test this, you can use the nightly version of NetVips. Add the https://ci.appveyor.com/nuget/net-vips feed in the <packageSources> section of your NuGet.config:

<packageSources>
  <add key="netvips-nightly" value="https://ci.appveyor.com/nuget/net-vips" />
</packageSources>

And update NetVips to 2.0.0 (build number 239 - prerelease). I'll try to release this as v2.0.0 soon.

@kleisauke kleisauke added this to the 2.0.0 milestone Feb 6, 2021
@kleisauke
Copy link
Owner

NetVips v2.0.0 is now available. Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-breaker Breaking API changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants