+Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
+
+ * color-man.[ch]: Allow color manager to work with GdkPixbufs not
+ linked to an ImageWindow. Fix missing embedded dummy function when
+ compiling without color profile support.
+ * image.c: When embedded color profiles is enabled and EXIF ColorSpace
+ is set to 1 use sRGB color profile for the image. Also fixed order of
+ starting the image read-ahead when color profiles are in use.
+ * typedefs.h (ImageWindow): Use gpointer definition correctly so that
+ cm is a pointer and not a pointer to a pointer.
+ * utilops.c: Pass 0 to vertical fill arg of gtk_table_attach() instead
+ of FALSE.
+
Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
* bar_exif.c, cache-loader.c, pan-view.c: Pass new arg for exif_read().
> color profiles:
d> support profiles embedded in images
- > check if clamp arg is handled correct in post_process_*()
+ d> check if clamp arg is handled correct in post_process_*()
> add support in img-view.c
---
Minor (non blockers):
----------------------------------------------
-d> update icon used for window to the (not so) new icon
-
> fix gtk_table_attach use to not use FALSE for fill vertical arg.
> xv and xpaint are hardly used or even installed by any distro anymore - time
to remove these (and find alternates?) seems silly to only have gimp.
-d> update .desktop MimeType list to match Fedora's patch for missing formats
-
> allow editor commands to be interrupted (via SIGTERM?)
> fix hanging editor commands that await user input (how to handle, or even detect this?)
> fix printing of transparent images to not use black for transparency (white or user settable).
-d> add [shift]+G to display as greyscale
-
> fix comment field in keywords bar to a height of 2 or 3 text lines.
> add toolbar to: (UPDATE: these toolbars may not make it into 1.6)
> Initiating full screen from the command line should not
show main window until full screen is exited.
-d> add --geometry suipport
-
> Add shortcut to jump to next folder within parent folder.
> add animated image support
cmsDoTransform(cc->transform, pbuf, pbuf, w);
}
- image_area_changed(cm->imd, x, y, w, h);
+ if (cm->incremental_sync && cm->imd) image_area_changed(cm->imd, x, y, w, h);
}
static gint color_man_idle_cb(gpointer data)
gint width, height;
gint rh;
- if (cm->pixbuf != image_get_pixbuf(cm->imd))
+ if (cm->imd &&
+ cm->pixbuf != image_get_pixbuf(cm->imd))
{
cm->idle_id = -1;
color_man_done(cm, COLOR_RETURN_IMAGE_CHANGED);
if (cm->row > height)
{
+ if (!cm->incremental_sync && cm->imd)
+ {
+ image_area_changed(cm->imd, 0, 0, width, height);
+ }
+
cm->idle_id = -1;
color_man_done(cm, COLOR_RETURN_SUCCESS);
return FALSE;
return TRUE;
}
-static ColorMan *color_man_new_real(ImageWindow *imd,
+static ColorMan *color_man_new_real(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
unsigned char *input_data, guint input_data_len,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc done_func, gpointer done_data)
{
ColorMan *cm;
- GdkPixbuf *pixbuf;
gint has_alpha;
- if (!imd) return NULL;
-
- pixbuf = image_get_pixbuf(imd);
+ if (imd) pixbuf = image_get_pixbuf(imd);
if (!pixbuf) return NULL;
cm = g_new0(ColorMan, 1);
cm->imd = imd;
cm->pixbuf = pixbuf;
+ g_object_ref(cm->pixbuf);
+
+ cm->incremental_sync = FALSE;
cm->row = 0;
cm->idle_id = -1;
return cm;
}
-ColorMan *color_man_new(ImageWindow *imd,
+ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc done_func, gpointer done_data)
{
- return color_man_new_real(imd,
+ return color_man_new_real(imd, pixbuf,
input_type, input_file, NULL, 0,
screen_type, screen_file,
done_func, done_data);
}
-ColorMan *color_man_new_embedded(ImageWindow *imd,
+ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
unsigned char *input_data, guint input_data_len,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc done_func, gpointer done_data)
{
- return color_man_new_real(imd,
+ return color_man_new_real(imd, pixbuf,
COLOR_PROFILE_MEM, NULL, input_data, input_data_len,
screen_type, screen_file,
done_func, done_data);
if (!cm) return;
if (cm->idle_id != -1) g_source_remove(cm->idle_id);
+ if (cm->pixbuf) g_object_unref(cm->pixbuf);
color_man_cache_unref(cm->profile);
/*** color support not enabled ***/
-ColorMan *color_man_new(ImageWindow *imd,
+ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc don_func, gpointer done_data)
return NULL;
}
+ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
+ unsigned char *input_data, guint input_data_len,
+ ColorManProfileType screen_type, const gchar *screen_file,
+ ColorManDoneFunc done_func, gpointer done_data)
+{
+ /* no op */
+ return NULL;
+}
+
void color_man_free(ColorMan *cm)
{
/* no op */
struct _ColorMan {
ImageWindow *imd;
GdkPixbuf *pixbuf;
+ gint incremental_sync;
gint row;
gpointer profile;
};
-ColorMan *color_man_new(ImageWindow *imd,
+ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc done_func, gpointer done_data);
-ColorMan *color_man_new_embedded(ImageWindow *imd,
+ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
unsigned char *input_data, guint input_data_len,
ColorManProfileType screen_type, const gchar *screen_file,
ColorManDoneFunc done_func, gpointer done_data);
/*
* GQview
- * (C) 2005 John Ellis
+ * (C) 2006 John Ellis
*
* Author: John Ellis
*
static void image_update_title(ImageWindow *imd);
static void image_post_process(ImageWindow *imd, gint clamp);
+static void image_read_ahead_start(ImageWindow *imd);
/*
*-------------------------------------------------------------------
{
ImageWindow *imd = data;
- color_man_free((ColorMan *)imd->cm);
+ color_man_free(cm);
+ if (type == COLOR_RETURN_IMAGE_CHANGED)
+ {
+ if (cm == imd->cm) imd->cm = NULL;
+ return;
+ }
+
imd->cm = NULL;
imd->state |= IMAGE_STATE_COLOR_ADJ;
- if (type != COLOR_RETURN_IMAGE_CHANGED)
- {
- image_post_process_alter(imd, FALSE);
- }
+ image_post_process_alter(imd, FALSE);
+
+ image_read_ahead_start(imd);
}
static gint image_post_process_color(ImageWindow *imd, gint start_row, ExifData *exif)
if (imd->color_profile_use_image && exif)
{
item = exif_get_item(exif, "ColorProfile");
+ if (!item)
+ {
+ gint cs;
+
+ /* ColorSpace == 1 specifies sRGB per EXIF 2.2 */
+ if (exif_get_integer(exif, "ColorSpace", &cs) &&
+ cs == 1)
+ {
+ input_type = COLOR_PROFILE_SRGB;
+ input_file = NULL;
+
+ if (debug) printf("Found EXIF ColorSpace of sRGB\n");
+ }
+ }
}
if (item && item->format == EXIF_FORMAT_UNDEFINED)
{
if (debug) printf("Found embedded color profile\n");
- cm = color_man_new_embedded(imd,
+ cm = color_man_new_embedded(imd, NULL,
item->data, item->data_len,
screen_type, screen_file,
image_post_process_color_cb, imd);
}
else
{
- cm = color_man_new(imd,
+ cm = color_man_new(imd, NULL,
input_type, input_file,
screen_type, screen_file,
image_post_process_color_cb, imd);
if (!imd->read_ahead_path || imd->read_ahead_il || imd->read_ahead_pixbuf) return;
/* still loading ?, do later */
- if (imd->il) return;
+ if (imd->il || imd->cm) return;
if (debug) printf("read ahead started for :%s\n", imd->read_ahead_path);
/*
* GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
*
* Author: John Ellis
*
gint color_profile_input;
gint color_profile_screen;
gint color_profile_use_image;
- gpointer *cm;
+ gpointer cm;
AlterType delay_alter_type;
pref_table_label(table, 0, 1, _("New name:"), 1.0);
rd->rename_entry = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), rd->rename_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, FALSE, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), rd->rename_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0);
generic_dialog_attach_default(GENERIC_DIALOG(rd->fd), rd->rename_entry);
gtk_widget_grab_focus(rd->rename_entry);
pref_table_label(table, 0, 1, _("New name:"), 1.0);
fd->entry = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), fd->entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, FALSE, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), fd->entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0);
generic_dialog_attach_default(GENERIC_DIALOG(fd), fd->entry);
gtk_widget_grab_focus(fd->entry);