diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f97ed72..94f420ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1396,7 +1396,7 @@ foreach(libtype ${TEST_LIBTYPES})
set(TESTORIG testorig12.jpg)
set(MD5_JPEG_RGB_ISLOW 9d7369207c520d37f2c1cbfcb82b2964)
- set(MD5_JPEG_RGB_ISLOW2 a00bd20d8ae49684640ef7177d2e0b64)
+ set(MD5_JPEG_RGB_ISLOW2 e619791332a99813bdca9f56fd60f9f9)
set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0)
set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4)
set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950)
@@ -1462,7 +1462,7 @@ foreach(libtype ${TEST_LIBTYPES})
set(TESTORIG testorig.jpg)
set(MD5_JPEG_RGB_ISLOW 1d44a406f61da743b5fd31c0a9abdca3)
- set(MD5_JPEG_RGB_ISLOW2 31d121e57b6c2934c890a7fc7763bcd4)
+ set(MD5_JPEG_RGB_ISLOW2 b811e5ad807beb9384e51ef6a47f715d)
set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291)
set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be)
set(MD5_BMP_RGB_ISLOW_565D 4cfa0928ef3e6bb626d7728c924cfda4)
@@ -1556,7 +1556,7 @@ foreach(libtype ${TEST_LIBTYPES})
set_tests_properties(${djpeg}-${libtype}-rgb-islow-icc-cmp PROPERTIES
DEPENDS ${djpeg}-${libtype}-rgb-islow)
- add_bittest(${jpegtran} icc "-copy;all;-icc;${TESTIMAGES}/test2.icc"
+ add_bittest(${jpegtran} icc "-copy;all;-icc;${TESTIMAGES}/test3.icc"
${testout}_rgb_islow2.jpg ${testout}_rgb_islow.jpg
${MD5_JPEG_RGB_ISLOW2} ${cjpeg}-${libtype}-rgb-islow)
diff --git a/ChangeLog.md b/ChangeLog.md
index 381a74cc..3f1ae82a 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -123,6 +123,10 @@ cropping regions to be unduly rejected when performing 90-degree rotation,
270-degree rotation, transposition, transverse transposition, or grayscale
conversion.
+8. Fixed an issue whereby the TurboJPEG lossless transformation function and
+methods did not honor `TJXOPT_COPYNONE`/`TJTransform.OPT_COPYNONE` unless it
+was specified for all lossless transforms.
+
3.0.3
=====
diff --git a/java/doc/index-all.html b/java/doc/index-all.html
index ec73e635..504a9ad4 100644
--- a/java/doc/index-all.html
+++ b/java/doc/index-all.html
@@ -329,7 +329,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
getCompressedSize() - Method in class org.libjpegturbo.turbojpeg.TJCompressor
Returns the size of the image (in bytes) generated by the most recent
- compress operation.
+ compression operation.
getDenom() - Method in class org.libjpegturbo.turbojpeg.TJScalingFactor
diff --git a/java/doc/member-search-index.zip b/java/doc/member-search-index.zip
index cff9f503..ce60eedc 100644
Binary files a/java/doc/member-search-index.zip and b/java/doc/member-search-index.zip differ
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
index 85bd67df..1d86d483 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
@@ -276,7 +276,7 @@ implements java.io.Closeable
getCompressedSize() |
Returns the size of the image (in bytes) generated by the most recent
- compress operation.
+ compression operation.
|
@@ -1025,11 +1025,11 @@ implements java.io.Closeable
getCompressedSize
public int getCompressedSize()
Returns the size of the image (in bytes) generated by the most recent
- compress operation.
+ compression operation.
- Returns:
- the size of the image (in bytes) generated by the most recent
- compress operation.
+ compression operation.
diff --git a/java/doc/package-search-index.zip b/java/doc/package-search-index.zip
index d2ed8216..b9bf7b3b 100644
Binary files a/java/doc/package-search-index.zip and b/java/doc/package-search-index.zip differ
diff --git a/java/doc/type-search-index.zip b/java/doc/type-search-index.zip
index 7fcb757b..a0b8d4af 100644
Binary files a/java/doc/type-search-index.zip and b/java/doc/type-search-index.zip differ
diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
index 795940f3..c49efc62 100644
--- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
@@ -711,10 +711,10 @@ public class TJCompressor implements Closeable {
/**
* Returns the size of the image (in bytes) generated by the most recent
- * compress operation.
+ * compression operation.
*
* @return the size of the image (in bytes) generated by the most recent
- * compress operation.
+ * compression operation.
*/
public int getCompressedSize() {
return compressedSize;
diff --git a/src/transupp.c b/src/transupp.c
index 62587d38..0a92413a 100644
--- a/src/transupp.c
+++ b/src/transupp.c
@@ -2315,19 +2315,20 @@ jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
#ifdef SAVE_MARKERS_SUPPORTED
int m;
- /* Save comments except under NONE option */
+ /* Save comments unless JCOPYOPT_NONE or JCOPYOPT_ICC specified */
if (option != JCOPYOPT_NONE && option != JCOPYOPT_ICC) {
jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
}
- /* Save all types of APPn markers iff ALL option */
+ /* Save all APPn markers iff JCOPYOPT_ALL* specified ... */
if (option == JCOPYOPT_ALL || option == JCOPYOPT_ALL_EXCEPT_ICC) {
for (m = 0; m < 16; m++) {
+ /* ... except APP2 markers if JCOPYOPT_ALL_EXCEPT_ICC specified */
if (option == JCOPYOPT_ALL_EXCEPT_ICC && m == 2)
continue;
jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
}
}
- /* Save only APP2 markers if ICC option selected */
+ /* Save only APP2 markers if JCOPYOPT_ICC specified */
if (option == JCOPYOPT_ICC) {
jpeg_save_markers(srcinfo, JPEG_APP0 + 2, 0xFFFF);
}
@@ -2347,12 +2348,22 @@ jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
{
jpeg_saved_marker_ptr marker;
- /* In the current implementation, we don't actually need to examine the
- * option flag here; we just copy everything that got saved.
- * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
- * if the encoder library already wrote one.
- */
for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
+ if (option == JCOPYOPT_NONE)
+ continue;
+ else if (option == JCOPYOPT_COMMENTS) {
+ if (marker->marker != JPEG_COM)
+ continue;
+ } else if (option == JCOPYOPT_ALL_EXCEPT_ICC) {
+ if (marker->marker == JPEG_APP0 + 2)
+ continue;
+ } else if (option == JCOPYOPT_ICC) {
+ if (marker->marker != JPEG_APP0 + 2)
+ continue;
+ }
+ /* To avoid confusion, we do not output JFIF and Adobe APP14 markers if the
+ * encoder library already wrote one.
+ */
if (dstinfo->write_JFIF_header &&
marker->marker == JPEG_APP0 &&
marker->data_length >= 5 &&
diff --git a/test/tjbenchtest.in b/test/tjbenchtest.in
index 65d8565d..271c44e6 100755
--- a/test/tjbenchtest.in
+++ b/test/tjbenchtest.in
@@ -20,7 +20,7 @@ runme()
}
EXT=bmp
-IMAGES="vgl_5674_0098.${EXT} vgl_6434_0018a.${EXT} vgl_6548_0026a.${EXT} big_tree8.${EXT}"
+IMAGES="vgl_5674_0098.${EXT} vgl_6434_0018a.${EXT} vgl_6548_0026a.${EXT} shira_bird8.${EXT}"
IMGDIR=@CMAKE_SOURCE_DIR@/testimages
OUTDIR=`mktemp -d /tmp/__tjbenchtest_output.XXXXXX`
EXEDIR=@CMAKE_BINARY_DIR@
@@ -64,12 +64,12 @@ while [ $# -gt 0 ]; do
# each downsampled dimension is an odd number or is evenly divisible by the MCU
# width/height. This disagreement basically amounts to a round-off error, but
# there is no easy way around it, so for now, we just test the only image that
-# works. (NOTE: big_tree8 does not suffer from the above issue, but it suffers
-# from an unrelated problem whereby the combination of tj3DecompressToYUV*()
-# and tj3DecodeYUV*() do not produce bitwise-identical results to
-# tj3Decompress*() if decompression scaling is enabled. This latter phenomenon
-# is not yet fully understood but is also believed to be some sort of round-off
-# error.)
+# works. (NOTE: shira_bird8 does not suffer from the above issue, but it
+# suffers from an unrelated problem whereby the combination of
+# tj3DecompressToYUV*() and tj3DecodeYUV*() do not produce bitwise-identical
+# results to tj3Decompress*() if decompression scaling is enabled. This latter
+# phenomenon is not yet fully understood but is also believed to be some sort
+# of round-off error.)
IMAGES="vgl_6548_0026a.${EXT}"
;;
-alloc)
@@ -110,7 +110,7 @@ while [ $# -gt 0 ]; do
PRECISION=$1
if [ $PRECISION != 8 ]; then
EXT=ppm
- IMAGES="big_building16.${EXT}"
+ IMAGES="monkey16.${EXT}"
BMPARG=
fi
;;
@@ -125,7 +125,7 @@ if [ $PRECISION = 8 -a "$YUVARG" = "" ]; then
IMAGES="vgl_6548_0026a.${EXT}"
elif [ "$ENTROPYARG" = "-arithmetic" -o \
"$ENTROPYARG" = "-progressive-arithmetic" ]; then
- IMAGES="big_tree8.${EXT}"
+ IMAGES="shira_bird8.${EXT}"
fi
fi
diff --git a/test/tjcomptest.in b/test/tjcomptest.in
index 77b49def..a2068f7a 100755
--- a/test/tjcomptest.in
+++ b/test/tjcomptest.in
@@ -58,8 +58,8 @@ for precision in 8 12; do
RGBIMG=$IMGDIR/testorig.ppm
GRAYIMG=$IMGDIR/testorig.pgm
else
- RGBIMG=$IMGDIR/big_building16.ppm
- GRAYIMG=$IMGDIR/big_building16.pgm
+ RGBIMG=$IMGDIR/monkey16.ppm
+ GRAYIMG=$IMGDIR/monkey16.pgm
fi
for restartarg in "" "-r 1" "-r 1b"; do
for ariarg in "" "-a"; do
@@ -151,8 +151,8 @@ for precision in {2..16}; do
RGBIMG=$IMGDIR/testorig.ppm
GRAYIMG=$IMGDIR/testorig.pgm
else
- RGBIMG=$IMGDIR/big_building16.ppm
- GRAYIMG=$IMGDIR/big_building16.pgm
+ RGBIMG=$IMGDIR/monkey16.ppm
+ GRAYIMG=$IMGDIR/monkey16.pgm
fi
for psv in {1..7}; do
for pt in {0..15}; do
diff --git a/test/tjdecomptest.in b/test/tjdecomptest.in
index ce517439..ab2eaff2 100755
--- a/test/tjdecomptest.in
+++ b/test/tjdecomptest.in
@@ -58,8 +58,8 @@ for precision in 8 12; do
RGBIMG=$IMGDIR/testorig.ppm
GRAYIMG=$IMGDIR/testorig.pgm
else
- RGBIMG=$IMGDIR/big_building16.ppm
- GRAYIMG=$IMGDIR/big_building16.pgm
+ RGBIMG=$IMGDIR/monkey16.ppm
+ GRAYIMG=$IMGDIR/monkey16.pgm
fi
for sampi in {0..6}; do
@@ -166,8 +166,8 @@ for precision in {2..16}; do
RGBIMG=$IMGDIR/testorig.ppm
GRAYIMG=$IMGDIR/testorig.pgm
else
- RGBIMG=$IMGDIR/big_building16.ppm
- GRAYIMG=$IMGDIR/big_building16.pgm
+ RGBIMG=$IMGDIR/monkey16.ppm
+ GRAYIMG=$IMGDIR/monkey16.pgm
fi
basename=`basename $RGBIMG .ppm`
diff --git a/test/tjtrantest.in b/test/tjtrantest.in
index 8324ff2f..ae0204ea 100755
--- a/test/tjtrantest.in
+++ b/test/tjtrantest.in
@@ -58,8 +58,8 @@ for precision in 8 12; do
RGBIMG=$IMGDIR/testorig.ppm
GRAYIMG=$IMGDIR/testorig.pgm
else
- RGBIMG=$IMGDIR/big_building16.ppm
- GRAYIMG=$IMGDIR/big_building16.pgm
+ RGBIMG=$IMGDIR/monkey16.ppm
+ GRAYIMG=$IMGDIR/monkey16.pgm
fi
for sampi in {0..6}; do
diff --git a/testimages/big_building16.pgm b/testimages/big_building16.pgm
deleted file mode 100644
index 87a0149a..00000000
Binary files a/testimages/big_building16.pgm and /dev/null differ
diff --git a/testimages/big_building16.ppm b/testimages/big_building16.ppm
deleted file mode 100644
index b0b84393..00000000
Binary files a/testimages/big_building16.ppm and /dev/null differ
diff --git a/testimages/big_tree8.bmp b/testimages/big_tree8.bmp
deleted file mode 100644
index b1dfc45f..00000000
Binary files a/testimages/big_tree8.bmp and /dev/null differ
diff --git a/testimages/big_tree8.txt b/testimages/big_tree8.txt
deleted file mode 100644
index 2f0be720..00000000
--- a/testimages/big_tree8.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-libjpeg-turbo note: This image was extracted from the 8-bit big_tree image.
-The original can be downloaded at the link below.
-
-The New Image Compression Test Set - Jan 2008
-http://www.imagecompression.info/test_images
-
-The images historically used for compression research (lena, barbra, pepper etc...) have outlived their useful life and its about time they become a part of history only. They are too small, come from data sources too old and are available in only 8-bit precision.
-
-These images have been carefully selected to aid in image compression algorithm research and evaluation. These are photographic images chosen to come from a wide variety of sources and each one picked to stress different aspects of algorithms. Images are available in 8-bit, 16-bit and 16-bit linear variations, RGB and gray.
-
-Images are available without any prohibitive copyright restrictions.
-
-These images are (c) there respective owners. You are granted full redistribution and publication rights on these images provided:
-
-1. The origin of the pictures must not be misrepresented; you must not claim that you took the original pictures. If you use, publish or redistribute them, an acknowledgment would be appreciated but is not required.
-2. Altered versions must be plainly marked as such, and must not be misinterpreted as being the originals.
-3. No payment is required for distribution this material, it must be available freely under the conditions stated here. That is, it is prohibited to sell the material.
-4. This notice may not be removed or altered from any distribution.
-
-Acknowledgments: A lot of people contributed a lot of time and effort in making this test set possible. Thanks to everyone who voiced their opinion in any of the discussions online. Thanks to Axel Becker, Thomas Richter and Niels Fröhling for their extensive help in picking images, running all the various tests etc... Thanks to Pete Fraser, Tony Story, Wayne J. Cosshall, David Coffin, Bruce Lindbloom and raw.fotosite.pl for the images which make up this set.
-
-Sachin Garg [India]
-sachingarg@c10n.info
-
-www.sachingarg.com | www.c10n.info | www.imagecompression.info
diff --git a/testimages/monkey16.pgm b/testimages/monkey16.pgm
new file mode 100644
index 00000000..3ae173b8
Binary files /dev/null and b/testimages/monkey16.pgm differ
diff --git a/testimages/monkey16.ppm b/testimages/monkey16.ppm
new file mode 100644
index 00000000..cfcd1b9a
Binary files /dev/null and b/testimages/monkey16.ppm differ
diff --git a/testimages/shira_bird8.bmp b/testimages/shira_bird8.bmp
new file mode 100644
index 00000000..81f4e2d1
Binary files /dev/null and b/testimages/shira_bird8.bmp differ
diff --git a/testimages/test2.icc b/testimages/test2.icc
deleted file mode 100644
index 73f1b5aa..00000000
Binary files a/testimages/test2.icc and /dev/null differ
diff --git a/testimages/test3.icc b/testimages/test3.icc
new file mode 100644
index 00000000..d0e79301
Binary files /dev/null and b/testimages/test3.icc differ
diff --git a/testimages/test2.icc.txt b/testimages/test3.icc.txt
similarity index 100%
rename from testimages/test2.icc.txt
rename to testimages/test3.icc.txt