diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c index e8183179..d8a30bb8 100644 --- a/libvips/foreign/vips2jpeg.c +++ b/libvips/foreign/vips2jpeg.c @@ -613,6 +613,7 @@ write_vips( Write *write, int qfac, const char *profile, */ if( restart_interval > 0 ) write->cinfo.restart_interval = restart_interval; + #ifdef HAVE_JPEG_EXT_PARAMS /* Apply trellis quantisation to each 8x8 block. Implies * "optimize_coding". @@ -853,7 +854,7 @@ vips__jpeg_write_target( VipsImage *in, VipsTarget *target, gboolean strip, gboolean trellis_quant, gboolean overshoot_deringing, gboolean optimize_scans, int quant_table, VipsForeignSubsample subsample_mode, - int restart_interval) + int restart_interval ) { Write *write; diff --git a/test/test-suite/test_foreign.py b/test/test-suite/test_foreign.py index 38e129a9..2f2470fc 100644 --- a/test/test-suite/test_foreign.py +++ b/test/test-suite/test_foreign.py @@ -303,6 +303,12 @@ class TestForeign: assert len(r10) > len(r0) assert len(r2) > len(r10) + # we should be able to reload jpegs with extra MCU markers + im0 = pyvips.Image.jpegload_buffer(r0) + im10 = pyvips.Image.jpegload_buffer(r10) + assert im0.avg() == im10.avg() + + @skip_if_no("jpegload") def test_truncated(self): # This should open (there's enough there for the header)