vips-ffm icon indicating copy to clipboard operation
vips-ffm copied to clipboard

Saving image to format determined by file extension

Open JohannesBeranek opened this issue 5 months ago • 4 comments

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.

JohannesBeranek avatar Sep 27 '24 15:09 JohannesBeranek