From 9e4d86333a95868fa330658824fa6000f2ed615e Mon Sep 17 00:00:00 2001 From: "Adam D. Moss" Date: Fri, 31 Jul 1998 17:54:33 +0000 Subject: [PATCH] Removed an ancient kludge that was seriously confusing the layer-mode * app/layers_dialog.c: Removed an ancient kludge that was seriously confusing the layer-mode menu. * plug-ins/psd/psd.c: Support OVERLAY_MODE where available --- ChangeLog | 7 +++++++ app/gui/layers-dialog.c | 4 +--- app/layers_dialog.c | 4 +--- plug-ins/common/psd.c | 25 ++++++++++++++++++------- plug-ins/psd/psd.c | 25 ++++++++++++++++++------- 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c12023bfa..be5d32cc45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Jul 31 18:29:44 BST 1998 Adam D. Moss + + * app/layers_dialog.c: Removed an ancient kludge that was + seriously confusing the layer-mode menu. + + * plug-ins/psd/psd.c: Support OVERLAY_MODE where available + Fri Jul 31 13:42:29 BST 1998 Adam D. Moss * plug-ins/psd/psd.c: Worked around some buggy PSD savers diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index f085dcf8fa..cd75f7d12c 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -2843,9 +2843,7 @@ layer_widget_layer_flush (GtkWidget *widget, layersD->opacity_data->value = (gfloat) layer_widget->layer->opacity / 2.55; gtk_signal_emit_by_name (GTK_OBJECT (layersD->opacity_data), "value_changed"); gtk_option_menu_set_history (GTK_OPTION_MENU (layersD->mode_option_menu), - /* Kludge to deal with the absence of behind */ - ((layer_widget->layer->mode > BEHIND_MODE) ? - layer_widget->layer->mode - 1 : layer_widget->layer->mode)); + layer_widget->layer->mode); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (layersD->preserve_trans), (layer_widget->layer->preserve_trans) ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL); diff --git a/app/layers_dialog.c b/app/layers_dialog.c index f085dcf8fa..cd75f7d12c 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -2843,9 +2843,7 @@ layer_widget_layer_flush (GtkWidget *widget, layersD->opacity_data->value = (gfloat) layer_widget->layer->opacity / 2.55; gtk_signal_emit_by_name (GTK_OBJECT (layersD->opacity_data), "value_changed"); gtk_option_menu_set_history (GTK_OPTION_MENU (layersD->mode_option_menu), - /* Kludge to deal with the absence of behind */ - ((layer_widget->layer->mode > BEHIND_MODE) ? - layer_widget->layer->mode - 1 : layer_widget->layer->mode)); + layer_widget->layer->mode); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (layersD->preserve_trans), (layer_widget->layer->preserve_trans) ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL); diff --git a/plug-ins/common/psd.c b/plug-ins/common/psd.c index 700c42a7ea..91b7e93a7b 100644 --- a/plug-ins/common/psd.c +++ b/plug-ins/common/psd.c @@ -1,5 +1,5 @@ /* - * PSD Plugin version 1.9.9.9e (BETA) + * PSD Plugin version 1.9.9.9f (BETA) * This GIMP plug-in is designed to load Adobe Photoshop(tm) files (.PSD) * * Adam D. Moss @@ -36,6 +36,9 @@ /* * Revision history: * + * 98.07.31 / v1.9.9.9f / Adam D. Moss + * Use OVERLAY_MODE if available. + * * 98.07.31 / v1.9.9.9e / Adam D. Moss * Worked around some buggy PSD savers (suspect PS4 on Mac) - ugh. * Fixed a bug when loading layer masks of certain dimensions. @@ -424,14 +427,22 @@ psd_lmode_to_gimp_lmode (gchar modekey[4]) if (strncmp(modekey, "scrn", 4)==0) return(SCREEN_MODE); if (strncmp(modekey, "diss", 4)==0) return(DISSOLVE_MODE); if (strncmp(modekey, "diff", 4)==0) return(DIFFERENCE_MODE); + if (strncmp(modekey, "lum ", 4)==0) return(VALUE_MODE); - if (strncmp(modekey, "lum ", 4)==0) return(VALUE_MODE); /* ? */ - - printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using 'addition' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); +#if (GIMP_MAJOR_VERSION > 0) && (GIMP_MINOR_VERSION > 0) + if (strncmp(modekey, "over", 4)==0) return(OVERLAY_MODE); + printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using " + "'overlay' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); + if (strncmp(modekey, "hLit", 4)==0) return(/**/OVERLAY_MODE); + if (strncmp(modekey, "sLit", 4)==0) return(/**/OVERLAY_MODE); +#else + printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using " + "'addition' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); if (strncmp(modekey, "over", 4)==0) return(ADDITION_MODE); /* ? */ if (strncmp(modekey, "hLit", 4)==0) return(/**/ADDITION_MODE); if (strncmp(modekey, "sLit", 4)==0) return(/**/ADDITION_MODE); +#endif printf("PSD: Warning - UNKNOWN layer-blend mode, reverting to 'normal'\n"); @@ -1022,14 +1033,14 @@ do_layer_pixeldata(FILE *fd, guint32 *offset) /* we throw this away because in theory we can trust the data to unpack to the right length... hmm... */ - dumpchunk(height * 2, + throwchunk(height * 2, fd, "widthlist"); (*offset) += height * 2; blockread = (*offset); - IFDBG {printf("\nHere comes the guitar solo...\n"); - fflush(stdout);} + /*IFDBG {printf("\nHere comes the guitar solo...\n"); + fflush(stdout);}*/ for (linei=0; linei @@ -36,6 +36,9 @@ /* * Revision history: * + * 98.07.31 / v1.9.9.9f / Adam D. Moss + * Use OVERLAY_MODE if available. + * * 98.07.31 / v1.9.9.9e / Adam D. Moss * Worked around some buggy PSD savers (suspect PS4 on Mac) - ugh. * Fixed a bug when loading layer masks of certain dimensions. @@ -424,14 +427,22 @@ psd_lmode_to_gimp_lmode (gchar modekey[4]) if (strncmp(modekey, "scrn", 4)==0) return(SCREEN_MODE); if (strncmp(modekey, "diss", 4)==0) return(DISSOLVE_MODE); if (strncmp(modekey, "diff", 4)==0) return(DIFFERENCE_MODE); + if (strncmp(modekey, "lum ", 4)==0) return(VALUE_MODE); - if (strncmp(modekey, "lum ", 4)==0) return(VALUE_MODE); /* ? */ - - printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using 'addition' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); +#if (GIMP_MAJOR_VERSION > 0) && (GIMP_MINOR_VERSION > 0) + if (strncmp(modekey, "over", 4)==0) return(OVERLAY_MODE); + printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using " + "'overlay' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); + if (strncmp(modekey, "hLit", 4)==0) return(/**/OVERLAY_MODE); + if (strncmp(modekey, "sLit", 4)==0) return(/**/OVERLAY_MODE); +#else + printf("PSD: Warning - unsupported layer-blend mode '%c%c%c%c', using " + "'addition' mode\n", modekey[0], modekey[1], modekey[2], modekey[3]); if (strncmp(modekey, "over", 4)==0) return(ADDITION_MODE); /* ? */ if (strncmp(modekey, "hLit", 4)==0) return(/**/ADDITION_MODE); if (strncmp(modekey, "sLit", 4)==0) return(/**/ADDITION_MODE); +#endif printf("PSD: Warning - UNKNOWN layer-blend mode, reverting to 'normal'\n"); @@ -1022,14 +1033,14 @@ do_layer_pixeldata(FILE *fd, guint32 *offset) /* we throw this away because in theory we can trust the data to unpack to the right length... hmm... */ - dumpchunk(height * 2, + throwchunk(height * 2, fd, "widthlist"); (*offset) += height * 2; blockread = (*offset); - IFDBG {printf("\nHere comes the guitar solo...\n"); - fflush(stdout);} + /*IFDBG {printf("\nHere comes the guitar solo...\n"); + fflush(stdout);}*/ for (linei=0; linei