Mercurial > geeqie.yaz
comparison src/image.c @ 115:53b2bfdcff69
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.
author | gqview |
---|---|
date | Tue, 28 Nov 2006 17:06:47 +0000 |
parents | 50fc73e08550 |
children | 1bd40943dc2a |
comparison
equal
deleted
inserted
replaced
114:50fc73e08550 | 115:53b2bfdcff69 |
---|---|
1 /* | 1 /* |
2 * GQview | 2 * GQview |
3 * (C) 2005 John Ellis | 3 * (C) 2006 John Ellis |
4 * | 4 * |
5 * Author: John Ellis | 5 * Author: John Ellis |
6 * | 6 * |
7 * This software is released under the GNU General Public License (GNU GPL). | 7 * This software is released under the GNU General Public License (GNU GPL). |
8 * Please read the included file COPYING for more information. | 8 * Please read the included file COPYING for more information. |
43 static GList *image_list = NULL; | 43 static GList *image_list = NULL; |
44 | 44 |
45 | 45 |
46 static void image_update_title(ImageWindow *imd); | 46 static void image_update_title(ImageWindow *imd); |
47 static void image_post_process(ImageWindow *imd, gint clamp); | 47 static void image_post_process(ImageWindow *imd, gint clamp); |
48 static void image_read_ahead_start(ImageWindow *imd); | |
48 | 49 |
49 /* | 50 /* |
50 *------------------------------------------------------------------- | 51 *------------------------------------------------------------------- |
51 * 'signals' | 52 * 'signals' |
52 *------------------------------------------------------------------- | 53 *------------------------------------------------------------------- |
261 | 262 |
262 static void image_post_process_color_cb(ColorMan *cm, ColorManReturnType type, gpointer data) | 263 static void image_post_process_color_cb(ColorMan *cm, ColorManReturnType type, gpointer data) |
263 { | 264 { |
264 ImageWindow *imd = data; | 265 ImageWindow *imd = data; |
265 | 266 |
266 color_man_free((ColorMan *)imd->cm); | 267 color_man_free(cm); |
268 if (type == COLOR_RETURN_IMAGE_CHANGED) | |
269 { | |
270 if (cm == imd->cm) imd->cm = NULL; | |
271 return; | |
272 } | |
273 | |
267 imd->cm = NULL; | 274 imd->cm = NULL; |
268 imd->state |= IMAGE_STATE_COLOR_ADJ; | 275 imd->state |= IMAGE_STATE_COLOR_ADJ; |
269 | 276 |
270 if (type != COLOR_RETURN_IMAGE_CHANGED) | 277 image_post_process_alter(imd, FALSE); |
271 { | 278 |
272 image_post_process_alter(imd, FALSE); | 279 image_read_ahead_start(imd); |
273 } | |
274 } | 280 } |
275 | 281 |
276 static gint image_post_process_color(ImageWindow *imd, gint start_row, ExifData *exif) | 282 static gint image_post_process_color(ImageWindow *imd, gint start_row, ExifData *exif) |
277 { | 283 { |
278 ColorMan *cm; | 284 ColorMan *cm; |
322 } | 328 } |
323 | 329 |
324 if (imd->color_profile_use_image && exif) | 330 if (imd->color_profile_use_image && exif) |
325 { | 331 { |
326 item = exif_get_item(exif, "ColorProfile"); | 332 item = exif_get_item(exif, "ColorProfile"); |
333 if (!item) | |
334 { | |
335 gint cs; | |
336 | |
337 /* ColorSpace == 1 specifies sRGB per EXIF 2.2 */ | |
338 if (exif_get_integer(exif, "ColorSpace", &cs) && | |
339 cs == 1) | |
340 { | |
341 input_type = COLOR_PROFILE_SRGB; | |
342 input_file = NULL; | |
343 | |
344 if (debug) printf("Found EXIF ColorSpace of sRGB\n"); | |
345 } | |
346 } | |
327 } | 347 } |
328 if (item && item->format == EXIF_FORMAT_UNDEFINED) | 348 if (item && item->format == EXIF_FORMAT_UNDEFINED) |
329 { | 349 { |
330 if (debug) printf("Found embedded color profile\n"); | 350 if (debug) printf("Found embedded color profile\n"); |
331 | 351 |
332 cm = color_man_new_embedded(imd, | 352 cm = color_man_new_embedded(imd, NULL, |
333 item->data, item->data_len, | 353 item->data, item->data_len, |
334 screen_type, screen_file, | 354 screen_type, screen_file, |
335 image_post_process_color_cb, imd); | 355 image_post_process_color_cb, imd); |
336 } | 356 } |
337 else | 357 else |
338 { | 358 { |
339 cm = color_man_new(imd, | 359 cm = color_man_new(imd, NULL, |
340 input_type, input_file, | 360 input_type, input_file, |
341 screen_type, screen_file, | 361 screen_type, screen_file, |
342 image_post_process_color_cb, imd); | 362 image_post_process_color_cb, imd); |
343 } | 363 } |
344 | 364 |
491 { | 511 { |
492 /* already started ? */ | 512 /* already started ? */ |
493 if (!imd->read_ahead_path || imd->read_ahead_il || imd->read_ahead_pixbuf) return; | 513 if (!imd->read_ahead_path || imd->read_ahead_il || imd->read_ahead_pixbuf) return; |
494 | 514 |
495 /* still loading ?, do later */ | 515 /* still loading ?, do later */ |
496 if (imd->il) return; | 516 if (imd->il || imd->cm) return; |
497 | 517 |
498 if (debug) printf("read ahead started for :%s\n", imd->read_ahead_path); | 518 if (debug) printf("read ahead started for :%s\n", imd->read_ahead_path); |
499 | 519 |
500 imd->read_ahead_il = image_loader_new(imd->read_ahead_path); | 520 imd->read_ahead_il = image_loader_new(imd->read_ahead_path); |
501 | 521 |