From a9bfef2a571ae2fbae0a9fb27a583c42b06c82ee Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 25 May 2017 16:32:23 +0100 Subject: [PATCH] Reset scans to value expected by the TJ API Fixes #260 --- turbojpeg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbojpeg.c b/turbojpeg.c index 5e370d58..9434e325 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -2115,6 +2115,10 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle, &xinfo[i]); if(!(t[i].options&TJXOPT_NOOUTPUT)) { +#ifdef C_PROGRESSIVE_SUPPORTED + if (cinfo->num_scans != 0) /* process -progressive; -scans can override */ + jpeg_simple_progression(cinfo); +#endif jpeg_write_coefficients(cinfo, dstcoefs); jcopy_markers_execute(dinfo, cinfo, JCOPYOPT_ALL); }