Skip to content

Commit

Permalink
unconditionally enable fast jpeg thumbnailing
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Apr 6, 2009
1 parent 61856b1 commit 9e28ad2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ ConfOptions *init_options(ConfOptions *options)

options->thumbnails.cache_into_dirs = FALSE;
options->thumbnails.enable_caching = TRUE;
options->thumbnails.fast = TRUE;
options->thumbnails.max_height = DEFAULT_THUMB_HEIGHT;
options->thumbnails.max_width = DEFAULT_THUMB_WIDTH;
options->thumbnails.quality = GDK_INTERP_TILES;
Expand Down
1 change: 0 additions & 1 deletion src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ struct _ConfOptions
gint max_height;
gboolean enable_caching;
gboolean cache_into_dirs;
gboolean fast;
gboolean use_xvpics;
gboolean spec_standard;
guint quality;
Expand Down
4 changes: 0 additions & 4 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ static void config_window_apply(void)
}
options->thumbnails.enable_caching = c_options->thumbnails.enable_caching;
options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs;
options->thumbnails.fast = c_options->thumbnails.fast;
options->thumbnails.use_exif = c_options->thumbnails.use_exif;
#if 0
options->thumbnails.use_xvpics = c_options->thumbnails.use_xvpics;
Expand Down Expand Up @@ -930,9 +929,6 @@ static void config_tab_general(GtkWidget *notebook)
options->thumbnails.use_xvpics, &c_options->thumbnails.use_xvpics);
#endif

pref_checkbox_new_int(group, _("Faster jpeg thumbnailing (may reduce quality)"),
options->thumbnails.fast, &c_options->thumbnails.fast);

pref_checkbox_new_int(group, _("Use EXIF thumbnails when available"),
options->thumbnails.use_exif, &c_options->thumbnails.use_exif);

Expand Down
2 changes: 0 additions & 2 deletions src/rcfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ static void write_global_attributes(GString *outstr, gint indent)
WRITE_NL(); WRITE_INT(*options, thumbnails.max_height);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.enable_caching);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.cache_into_dirs);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.fast);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_xvpics);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.spec_standard);
WRITE_NL(); WRITE_UINT(*options, thumbnails.quality);
Expand Down Expand Up @@ -619,7 +618,6 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **

if (READ_BOOL(*options, thumbnails.enable_caching)) continue;
if (READ_BOOL(*options, thumbnails.cache_into_dirs)) continue;
if (READ_BOOL(*options, thumbnails.fast)) continue;
if (READ_BOOL(*options, thumbnails.use_xvpics)) continue;
if (READ_BOOL(*options, thumbnails.spec_standard)) continue;
if (READ_UINT_CLAMP(*options, thumbnails.quality, GDK_INTERP_NEAREST, GDK_INTERP_HYPER)) continue;
Expand Down
7 changes: 2 additions & 5 deletions src/thumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,8 @@ static void thumb_loader_setup(ThumbLoader *tl, const gchar *path)
file_data_unref(fd);
image_loader_set_priority(tl->il, G_PRIORITY_LOW);

if (options->thumbnails.fast)
{
/* this will speed up jpegs by up to 3x in some cases */
image_loader_set_requested_size(tl->il, tl->max_w, tl->max_h);
}
/* this will speed up jpegs by up to 3x in some cases */
image_loader_set_requested_size(tl->il, tl->max_w, tl->max_h);

g_signal_connect(G_OBJECT(tl->il), "error", (GCallback)thumb_loader_error_cb, tl);
if (tl->func_progress) g_signal_connect(G_OBJECT(tl->il), "percent", (GCallback)thumb_loader_percent_cb, tl);
Expand Down
19 changes: 8 additions & 11 deletions src/thumb_standard.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,18 +593,15 @@ static gboolean thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
tl->il = image_loader_new(fd);
image_loader_set_priority(tl->il, G_PRIORITY_LOW);

if (options->thumbnails.fast)
/* this will speed up jpegs by up to 3x in some cases */
if (tl->requested_width <= THUMB_SIZE_NORMAL &&
tl->requested_height <= THUMB_SIZE_NORMAL)
{
/* this will speed up jpegs by up to 3x in some cases */
if (tl->requested_width <= THUMB_SIZE_NORMAL &&
tl->requested_height <= THUMB_SIZE_NORMAL)
{
image_loader_set_requested_size(tl->il, THUMB_SIZE_NORMAL, THUMB_SIZE_NORMAL);
}
else
{
image_loader_set_requested_size(tl->il, THUMB_SIZE_LARGE, THUMB_SIZE_LARGE);
}
image_loader_set_requested_size(tl->il, THUMB_SIZE_NORMAL, THUMB_SIZE_NORMAL);
}
else
{
image_loader_set_requested_size(tl->il, THUMB_SIZE_LARGE, THUMB_SIZE_LARGE);
}

g_signal_connect(G_OBJECT(tl->il), "error", (GCallback)thumb_loader_std_error_cb, tl);
Expand Down

0 comments on commit 9e28ad2

Please sign in to comment.