Skip to content

Commit

Permalink
Add missing writeJPEGToArray method to Image interface
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyroussel authored and dbouron committed Mar 8, 2021
1 parent 99ad13e commit 09ea398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/criteo/vips/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/com/criteo/vips/VipsImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 09ea398

Please sign in to comment.