imd->color_profile_input < COLOR_PROFILE_FILE + COLOR_PROFILE_INPUTS)
{
const gchar *file = options->color_profile.input_file[imd->color_profile_input - COLOR_PROFILE_FILE];
-
+
if (!is_readable_file(file)) return FALSE;
input_type = COLOR_PROFILE_FILE;
imd->color_profile_from_image = COLOR_PROFILE_NONE;
exif = exif_read_fd(imd->image_fd);
-
+
if (exif)
{
profile = exif_get_color_profile(exif, &profile_len);
exif_free_fd(imd->image_fd, exif);
}
-
+
if (profile)
{
}
image_update_util(imd);
-
+
if (screen_profile)
{
g_free(screen_profile);
screen_profile = NULL;
}
-
+
return !!cm;
}
{
ImageWindow *imd = data;
+ if (!imd->read_ahead_fd || !imd->read_ahead_il) return;
+
DEBUG_1("%s read ahead done for :%s", get_exec_time(), imd->read_ahead_fd->path);
if (!imd->read_ahead_fd->pixbuf)
DEBUG_1("%s read ahead started for :%s", get_exec_time(), imd->read_ahead_fd->path);
imd->read_ahead_il = image_loader_new(imd->read_ahead_fd);
-
+
image_loader_delay_area_ready(imd->read_ahead_il, TRUE); /* we will need the area_ready signals later */
g_signal_connect(G_OBJECT(imd->read_ahead_il), "error", (GCallback)image_read_ahead_error_cb, imd);
g_assert(imd->image_fd->pixbuf);
image_change_pixbuf(imd, imd->image_fd->pixbuf, image_zoom_get(imd), FALSE);
}
-
+
// file_cache_dump(image_get_cache());
return success;
}
{
image_change_pixbuf(imd, image_loader_get_pixbuf(imd->il), image_zoom_get(imd), TRUE);
}
-*/
+*/
return TRUE;
}
if (is_readable_file(imd->image_fd->path))
{
PixbufRenderer *pr;
-
+
pr = PIXBUF_RENDERER(imd->pr);
pr->zoom = zoom; /* store the zoom, needed by the loader */
if (imd->unknown == TRUE)
{
GdkPixbuf *pixbuf;
-
+
pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN);
image_change_pixbuf(imd, pixbuf, zoom, FALSE);
g_object_unref(pixbuf);
/* read_exif and similar functions can actually notice that the file has changed and trigger
a notification that removes the pixbuf from cache and unrefs it. Therefore we must ref it
here before it is taken over by the renderer. */
- if (pixbuf) g_object_ref(pixbuf);
-
+ if (pixbuf) g_object_ref(pixbuf);
+
if (imd->image_fd)
{
if (imd->image_fd->user_orientation)
}
static void image_loader_sync_data(ImageLoader *il, gpointer old_data, gpointer data)
-{
+{
if (g_signal_handlers_disconnect_by_func(G_OBJECT(il), (GCallback)image_load_area_cb, old_data))
g_signal_connect(G_OBJECT(il), "area_ready", (GCallback)image_load_area_cb, data);
void image_stereo_set(ImageWindow *imd, gint stereo_mode)
{
- DEBUG_1("Setting stereo mode %04x for imd %p", stereo_mode, imd);
+ DEBUG_1("Setting stereo mode %04x for imd %p", stereo_mode, imd);
pixbuf_renderer_stereo_set((PixbufRenderer *)imd->pr, stereo_mode);
}
if ((type & NOTIFY_REREAD) && fd == imd->image_fd)
{
- /* there is no need to reload on NOTIFY_CHANGE,
- modified files should be detacted anyway and NOTIFY_REREAD should be recieved
+ /* there is no need to reload on NOTIFY_CHANGE,
+ modified files should be detacted anyway and NOTIFY_REREAD should be recieved
or they are removed from the filelist completely on "move" and "delete"
*/
DEBUG_1("Notify image: %s %04x", fd->path, type);
{
ColorMan *cm;
if (!imd) return FALSE;
-
+
cm = imd->cm;
if (!cm) return FALSE;
return color_man_get_status(cm, image_profile, screen_profile);
void image_select(ImageWindow *imd, gboolean select)
{
if (!imd->has_frame) return;
-
+
if (select)
{
gtk_widget_set_state(imd->widget, GTK_STATE_SELECTED);
void image_set_selectable(ImageWindow *imd, gboolean selectable)
{
if (!imd->has_frame) return;
-
+
gtk_frame_set_shadow_type(GTK_FRAME(imd->frame), GTK_SHADOW_NONE);
gtk_container_set_border_width(GTK_CONTAINER(imd->frame), selectable ? 4 : 0);
}
NULL);
pixbuf_renderer_set_parent((PixbufRenderer *)imd->pr, (GtkWindow *)imd->top_window);
-
+
image_stereo_set(imd, options->stereo.mode);
- pixbuf_renderer_stereo_fixed_set((PixbufRenderer *)imd->pr,
- options->stereo.fixed_w, options->stereo.fixed_h,
+ pixbuf_renderer_stereo_fixed_set((PixbufRenderer *)imd->pr,
+ options->stereo.fixed_w, options->stereo.fixed_h,
options->stereo.fixed_x1, options->stereo.fixed_y1,
options->stereo.fixed_x2, options->stereo.fixed_y2);
}
ImageWindow *imd = data;
image_free(imd);
}
-#if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
gboolean selectable_frame_draw_cb(GtkWidget *widget, cairo_t *cr, gpointer data)
{
GtkAllocation allocation;
g_object_unref(imd->pr);
gtk_widget_set_can_focus(imd->frame, TRUE);
gtk_widget_set_app_paintable(imd->frame, TRUE);
-
-#if GTK_CHECK_VERSION(3,0,0)
+
+#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect(G_OBJECT(imd->frame), "draw",
G_CALLBACK(selectable_frame_draw_cb), NULL);
#else