diff --git a/src/main/java/com/criteo/vips/Image.java b/src/main/java/com/criteo/vips/Image.java index ec44137e..43a0545f 100644 --- a/src/main/java/com/criteo/vips/Image.java +++ b/src/main/java/com/criteo/vips/Image.java @@ -252,6 +252,16 @@ public interface Image extends AutoCloseable { */ byte[] writePNGToArray(int compression, boolean palette, int colors, boolean strip) throws VipsException; + /** + * Write a VIPS Image to byte array in JPEG output format + * + * @param quality Quality factor + * @param strip Whether to remove all metadata from image + * @return Byte array of encoded VipsImageImpl + * @throws VipsException if error + */ + byte[] writeJPEGToArray(int quality, boolean strip) throws VipsException; + /** * Write VipsImage to file * diff --git a/src/main/java/com/criteo/vips/VipsImage.java b/src/main/java/com/criteo/vips/VipsImage.java index eba808de..ff1e71e4 100644 --- a/src/main/java/com/criteo/vips/VipsImage.java +++ b/src/main/java/com/criteo/vips/VipsImage.java @@ -220,13 +220,6 @@ public byte[] writePNGToArray(int compression, boolean palette, int colors, bool private native byte[] writePNGToArrayNative(int compression, boolean palette, int colors, boolean strip) throws VipsException; - /** - * Write a VIPS Image to a byte array as JPEG - * @param quality Quality factor - * @param strip Whether to remove all metadata from image - * @return JPEG image as byte array - * @throws VipsException - */ public byte[] writeJPEGToArray(int quality, boolean strip) throws VipsException { return writeJPEGToArrayNative(quality, strip); }