Commit 3fe809b9 authored by Paolo Bacchilega's avatar Paolo Bacchilega

Fixed creation of blur thumbnails for jpeg images

parent 7aec51ac
...@@ -205,7 +205,7 @@ _cairo_image_surface_create_from_jpeg (GInputStream *istream, ...@@ -205,7 +205,7 @@ _cairo_image_surface_create_from_jpeg (GInputStream *istream,
for (srcinfo.scale_denom = 1; srcinfo.scale_denom <= 16; srcinfo.scale_denom++) { for (srcinfo.scale_denom = 1; srcinfo.scale_denom <= 16; srcinfo.scale_denom++) {
jpeg_calc_output_dimensions (&srcinfo); jpeg_calc_output_dimensions (&srcinfo);
if ((srcinfo.output_width < requested_size) || (srcinfo.output_height < requested_size)) { if ((srcinfo.output_width < requested_size) || (srcinfo.output_height < requested_size)) {
srcinfo.scale_denom += 1; srcinfo.scale_denom -= 1;
break; break;
} }
} }
......
...@@ -1405,7 +1405,7 @@ exiv2_generate_thumbnail (const char *uri, ...@@ -1405,7 +1405,7 @@ exiv2_generate_thumbnail (const char *uri,
double ratio_delta = (image_ratio > thumbnail_ratio) ? (image_ratio - thumbnail_ratio) : (thumbnail_ratio - image_ratio); double ratio_delta = (image_ratio > thumbnail_ratio) ? (image_ratio - thumbnail_ratio) : (thumbnail_ratio - image_ratio);
if ((ratio_delta > MAX_RATIO_ERROR_TOLERANCE) /* the tolerance is used because the reduced image can have a slightly different ratio due to rounding errors */ if ((ratio_delta > MAX_RATIO_ERROR_TOLERANCE) /* the tolerance is used because the reduced image can have a slightly different ratio due to rounding errors */
|| (MAX (pixbuf_width, pixbuf_height) < (requested_size * 0.90))) /* ignore the embedded image if it's too small compared to the requested size */ || (MAX (pixbuf_width, pixbuf_height) < requested_size)) /* ignore the embedded image if it's too small compared to the requested size */
{ {
g_object_unref (pixbuf); g_object_unref (pixbuf);
return NULL; return NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment