… | |
… | |
311 | perlinterp_acquire (); |
311 | perlinterp_acquire (); |
312 | OUTPUT: |
312 | OUTPUT: |
313 | RETVAL |
313 | RETVAL |
314 | |
314 | |
315 | GdkPixbuf_noinc * |
315 | GdkPixbuf_noinc * |
316 | load_jpeg (SV *path, int thumbnail=0) |
316 | load_jpeg (SV *path, int thumbnail = 0, int iw = 0, int ih = 0) |
317 | CODE: |
317 | CODE: |
318 | { |
318 | { |
319 | struct jpeg_decompress_struct cinfo; |
319 | struct jpeg_decompress_struct cinfo; |
320 | struct jpg_err_mgr jerr; |
320 | struct jpg_err_mgr jerr; |
321 | guchar *data; |
321 | guchar *data; |
… | |
… | |
369 | { |
369 | { |
370 | cinfo.dct_method = JDCT_FASTEST; |
370 | cinfo.dct_method = JDCT_FASTEST; |
371 | cinfo.do_fancy_upsampling = FALSE; |
371 | cinfo.do_fancy_upsampling = FALSE; |
372 | |
372 | |
373 | while (cinfo.scale_denom < 8 |
373 | while (cinfo.scale_denom < 8 |
374 | && cinfo.output_width >= IW*4 |
374 | && cinfo.output_width >= iw*4 |
375 | && cinfo.output_height >= IH*4) |
375 | && cinfo.output_height >= ih*4) |
376 | { |
376 | { |
377 | cinfo.scale_denom <<= 1; |
377 | cinfo.scale_denom <<= 1; |
378 | jpeg_calc_output_dimensions (&cinfo); |
378 | jpeg_calc_output_dimensions (&cinfo); |
379 | } |
379 | } |
380 | } |
380 | } |