Description
OS: WSL: Unbuntu 20.04
Hello,
I am attempting to use ruby-vips 2.1 in a rails 6.1.3 application using ruby 3.0.0 to take file that has been decoded from a base64 encoded string and use #pngsave to save that file as an 8-bit png, by passing in the bitdepth option with the value 8. I discovered this documentation https://www.rubydoc.info/gems/ruby-vips/Vips/Image#pngsave-instance_method which says that 8 is a valid option though after reading this comment #230 (comment) I was not sure if only 1, 2 and 4 bit were supported. In any case regardless of the integer value I pass, the error that I get when attempting to do this does not make much sense; "Vips::Error (unable to call pngsave: unknown option bitdepth)". This is the code:
File.open('design.png', 'wb') do |f|
f.write(Base64.decode64(base_64_encoded_data))
end
im = Vips::Image.new_from_file('design.png')
im.pngsave('new_design.png', bitdepth: 4)
If I call the pngsave method with any other option it behaves as expected. I am a little embarrassed to admit I not sure how to check which version of libvips I installed a week ago with sudo apt-get install libvips on WSL Unbuntu after typing libvips -v, --version I was out of ideas :)