sw = gdk_pixbuf_get_width(pixbuf);
sh = gdk_pixbuf_get_height(pixbuf);
- if (tl->cache_enable && !tl->cache_hit &&
- (sw >= THUMB_SIZE_NORMAL || sh >= THUMB_SIZE_NORMAL || shrunk))
+ if (tl->cache_enable)
{
- gint cache_w, cache_h;
- gint thumb_w, thumb_h;
-
- if (tl->requested_width > THUMB_SIZE_NORMAL || tl->requested_height > THUMB_SIZE_NORMAL)
+ if (!tl->cache_hit)
{
- cache_w = cache_h = THUMB_SIZE_LARGE;
- }
- else
- {
- cache_w = cache_h = THUMB_SIZE_NORMAL;
- }
+ gint cache_w, cache_h;
- if (thumb_loader_std_scale_aspect(cache_w, cache_h, sw, sh,
- &thumb_w, &thumb_h))
- {
- pixbuf_thumb = gdk_pixbuf_scale_simple(pixbuf, thumb_w, thumb_h,
- (GdkInterpType)thumbnail_quality);
+ if (tl->requested_width > THUMB_SIZE_NORMAL || tl->requested_height > THUMB_SIZE_NORMAL)
+ {
+ cache_w = cache_h = THUMB_SIZE_LARGE;
+ }
+ else
+ {
+ cache_w = cache_h = THUMB_SIZE_NORMAL;
+ }
+
+ if (sw > cache_w || sh > cache_h || shrunk)
+ {
+ gint thumb_w, thumb_h;
+
+ if (thumb_loader_std_scale_aspect(cache_w, cache_h, sw, sh,
+ &thumb_w, &thumb_h))
+ {
+ pixbuf_thumb = gdk_pixbuf_scale_simple(pixbuf, thumb_w, thumb_h,
+ (GdkInterpType)thumbnail_quality);
+ }
+ else
+ {
+ pixbuf_thumb = pixbuf;
+ g_object_ref(G_OBJECT(pixbuf_thumb));
+ }
+
+ thumb_loader_std_save(tl, pixbuf_thumb);
+ }
}
- else
+ else if (tl->cache_hit &&
+ tl->cache_local && !tl->thumb_path_local)
{
- pixbuf_thumb = pixbuf;
- g_object_ref(G_OBJECT(pixbuf_thumb));
- }
-
- thumb_loader_std_save(tl, pixbuf_thumb);
- }
- else if (tl->cache_enable && tl->cache_local &&
- tl->cache_hit && !tl->thumb_path_local)
- {
- /* A local cache save was requested, but a valid thumb is in $HOME,
- * so specifically save as a local thumbnail.
- */
- g_free(tl->thumb_path);
- tl->thumb_path = NULL;
+ /* A local cache save was requested, but a valid thumb is in $HOME,
+ * so specifically save as a local thumbnail.
+ */
+ g_free(tl->thumb_path);
+ tl->thumb_path = NULL;
- tl->cache_hit = FALSE;
+ tl->cache_hit = FALSE;
- if (debug) printf("thumb copied: %s\n", tl->source_path);
+ if (debug) printf("thumb copied: %s\n", tl->source_path);
- thumb_loader_std_save(tl, pixbuf);
+ thumb_loader_std_save(tl, pixbuf);
+ }
}
if (sw <= tl->requested_width && sh <= tl->requested_height)