From 7ed186ed79a9cec68a14e53940bcfcca4229e40d Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 17 Jan 2023 18:18:27 -0600 Subject: [PATCH] TJDecompressor.java: Exception message tweak NO_ASSOC_ERROR is specific to JPEG source images, but the decompress() methods can handle YUV source images as well. --- java/org/libjpegturbo/turbojpeg/TJDecompressor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index c1ec6a7e..1b44f4b5 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -393,7 +393,7 @@ public class TJDecompressor implements Closeable { int pitch, int desiredHeight, int pixelFormat, int flags) throws TJException { if (jpegBuf == null && yuvImage == null) - throw new IllegalStateException(NO_ASSOC_ERROR); + throw new IllegalStateException("No source image is associated with this instance"); if (dstBuf == null || x < 0 || y < 0 || pitch < 0 || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) @@ -715,7 +715,7 @@ public class TJDecompressor implements Closeable { int stride, int desiredHeight, int pixelFormat, int flags) throws TJException { if (jpegBuf == null && yuvImage == null) - throw new IllegalStateException(NO_ASSOC_ERROR); + throw new IllegalStateException("No source image is associated with this instance"); if (dstBuf == null || x < 0 || y < 0 || stride < 0 || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)