--- CV/CV.xs 2015/07/04 05:31:17 1.46 +++ CV/CV.xs 2016/06/07 06:59:57 1.47 @@ -313,7 +313,7 @@ RETVAL GdkPixbuf_noinc * -load_jpeg (SV *path, int thumbnail=0) +load_jpeg (SV *path, int thumbnail = 0, int iw = 0, int ih = 0) CODE: { struct jpeg_decompress_struct cinfo; @@ -371,8 +371,8 @@ cinfo.do_fancy_upsampling = FALSE; while (cinfo.scale_denom < 8 - && cinfo.output_width >= IW*4 - && cinfo.output_height >= IH*4) + && cinfo.output_width >= iw*4 + && cinfo.output_height >= ih*4) { cinfo.scale_denom <<= 1; jpeg_calc_output_dimensions (&cinfo);