vips-ffm
vips-ffm copied to clipboard
Saving image to format determined by file extension
vips-ffm provides VImage::writeToTarget which, as far as I understood from libvips documentation itself, should allow to save an image without knowing what the target format will be, and have the library automatically determine it based on the format option (which should actually be the filename suffix, so include the leading ".", according to my testing).
How would one get a byte array out of a VTarget?
vTarget.getUnsafeStructAddress().asByteBuffer()
does not seem to give a byte buffer of the image or it's missing a NUL terminator or has some other issue.