comparison src/image.c @ 1916:69ab167a50f5

do not mix autodetected and user-defined stereo mode
author Vladimir Nadvornik <nadvornik@suse.cz>
date Sat, 14 May 2011 21:53:45 +0200
parents 6e146fa6ec29
children 4845663f466e 26dfd7a4d130
comparison
equal deleted inserted replaced
1915:afe4d301e291 1916:69ab167a50f5
1103 return pixbuf_renderer_get_pixbuf((PixbufRenderer *)imd->pr); 1103 return pixbuf_renderer_get_pixbuf((PixbufRenderer *)imd->pr);
1104 } 1104 }
1105 1105
1106 void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy) 1106 void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboolean lazy)
1107 { 1107 {
1108 1108 StereoPixbufData stereo_data = STEREO_PIXBUF_DEFAULT;
1109 /* read_exif and similar functions can actually notice that the file has changed and trigger 1109 /* read_exif and similar functions can actually notice that the file has changed and trigger
1110 a notification that removes the pixbuf from cache and unrefs it. Therefore we must ref it 1110 a notification that removes the pixbuf from cache and unrefs it. Therefore we must ref it
1111 here before it is taken over by the renderer. */ 1111 here before it is taken over by the renderer. */
1112 if (pixbuf) g_object_ref(pixbuf); 1112 if (pixbuf) g_object_ref(pixbuf);
1113 1113
1122 imd->orientation = metadata_read_int(imd->image_fd, ORIENTATION_KEY, EXIF_ORIENTATION_TOP_LEFT); 1122 imd->orientation = metadata_read_int(imd->image_fd, ORIENTATION_KEY, EXIF_ORIENTATION_TOP_LEFT);
1123 imd->image_fd->exif_orientation = imd->orientation; 1123 imd->image_fd->exif_orientation = imd->orientation;
1124 } 1124 }
1125 } 1125 }
1126 1126
1127 if (pixbuf && imd->user_stereo) 1127 if (pixbuf)
1128 { 1128 {
1129 g_object_set_data(G_OBJECT(pixbuf), "stereo_data", GINT_TO_POINTER(imd->user_stereo)); 1129 stereo_data = imd->user_stereo;
1130 if (stereo_data == STEREO_PIXBUF_DEFAULT)
1131 {
1132 stereo_data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pixbuf), "stereo_data"));
1133 }
1130 } 1134 }
1131 1135
1132 pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, NULL, NULL, FALSE); 1136 pixbuf_renderer_set_post_process_func((PixbufRenderer *)imd->pr, NULL, NULL, FALSE);
1133 if (imd->cm) 1137 if (imd->cm)
1134 { 1138 {
1136 imd->cm = NULL; 1140 imd->cm = NULL;
1137 } 1141 }
1138 1142
1139 if (lazy) 1143 if (lazy)
1140 { 1144 {
1141 pixbuf_renderer_set_pixbuf_lazy((PixbufRenderer *)imd->pr, pixbuf, zoom, imd->orientation); 1145 pixbuf_renderer_set_pixbuf_lazy((PixbufRenderer *)imd->pr, pixbuf, zoom, imd->orientation, stereo_data);
1142 } 1146 }
1143 else 1147 else
1144 { 1148 {
1145 pixbuf_renderer_set_pixbuf((PixbufRenderer *)imd->pr, pixbuf, zoom); 1149 pixbuf_renderer_set_pixbuf((PixbufRenderer *)imd->pr, pixbuf, zoom);
1146 pixbuf_renderer_set_orientation((PixbufRenderer *)imd->pr, imd->orientation); 1150 pixbuf_renderer_set_orientation((PixbufRenderer *)imd->pr, imd->orientation);
1151 pixbuf_renderer_set_stereo_data((PixbufRenderer *)imd->pr, stereo_data);
1147 } 1152 }
1148 1153
1149 if (pixbuf) g_object_unref(pixbuf); 1154 if (pixbuf) g_object_unref(pixbuf);
1150 1155
1151 if (imd->color_profile_enable) 1156 if (imd->color_profile_enable)