akash-akya / vix

Elixir extension for libvips
MIT License
166 stars 20 forks source link

Return type for Image.width/1, Image.height/1 seem incorrect #107

Closed kipcole9 closed 1 year ago

kipcole9 commented 1 year ago

As of Vix 0.17 the return types for Image.width/1 and Image.height/1 have changed from pos_integer() to non_neg_integer(). This manifests itself as a large number of dialyzer errors in Image.

In looking at the libvips docs for width I see:

Allowed values: [1,10000000]

Which leads me to believe that the change in spec for Vix 0.17 has introduced a bug and the correct type is indeed pos_integer().

akash-akya commented 1 year ago

Yes, looks like that. I was thinking of image with 0x0, but looking at the libvips, it appears to be not possible

akash-akya commented 1 year ago

@kipcole9 released v0.18.0 with correct typespec

kipcole9 commented 1 year ago

Thank you @akash-akya, that fixed all the dialyzer issues I was seeing.