Commit f379865f3 for imagemagick.org
commit f379865f37c409aa2c4395116124c37595af6064
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Mon Jun 29 07:07:51 2026 +0200
Removed all the #if 0 blocks that have been there for ages.
diff --git a/coders/xcf.c b/coders/xcf.c
index ab0984ed6..99b9d37c1 100644
--- a/coders/xcf.c
+++ b/coders/xcf.c
@@ -1074,38 +1074,9 @@ static MagickBooleanType ReadOneLayer(const ImageInfo *image_info,Image* image,
/* read in the layer mask */
if (layer_mask_offset != 0)
- {
- offset=SeekBlob(image, (MagickOffsetType) layer_mask_offset, SEEK_SET);
-
-#if 0 /* BOGUS: support layer masks! */
- layer_mask = xcf_load_layer_mask (info, gimage);
- if (layer_mask == 0)
- goto error;
-
- /* set the offsets of the layer_mask */
- GIMP_DRAWABLE (layer_mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
- GIMP_DRAWABLE (layer_mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
-
- gimp_layer_add_mask (layer, layer_mask, MagickFalse);
-
- layer->mask->apply_mask = apply_mask;
- layer->mask->edit_mask = edit_mask;
- layer->mask->show_mask = show_mask;
-#endif
- }
-
- /* attach the floating selection... */
-#if 0 /* BOGUS: we may need to read this, even if we don't support it! */
- if (add_floating_sel)
- {
- GimpLayer *floating_sel;
-
- floating_sel = info->floating_sel;
- floating_sel_attach (floating_sel, GIMP_DRAWABLE (layer));
- }
-#endif
+ offset=SeekBlob(image, (MagickOffsetType) layer_mask_offset, SEEK_SET);
- return MagickTrue;
+ return(MagickTrue);
}
/*
@@ -1498,80 +1469,18 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception)
offset=SeekBlob(image, saved_pos, SEEK_SET);
current_layer++;
}
-#if 0
- {
- /* NOTE: XCF layers are REVERSED from composite order! */
- signed int j;
- for (j=number_layers-1; j>=0; j--) {
- /* BOGUS: need to consider layer blending modes!! */
-
- if ( layer_info[j].visible ) { /* only visible ones, please! */
- CompositeImage(image, OverCompositeOp, layer_info[j].image,
- layer_info[j].offset_x, layer_info[j].offset_y );
- layer_info[j].image =DestroyImage( layer_info[j].image );
-
- /* If we do this, we'll get REAL gray images! */
- if ( doc_info.image_type == GIMP_GRAY ) {
- QuantizeInfo qi;
- GetQuantizeInfo(&qi);
- qi.colorspace = GRAYColorspace;
- QuantizeImage( &qi, layer_info[j].image );
- }
- }
- }
- }
-#else
- {
- /* NOTE: XCF layers are REVERSED from composite order! */
- ssize_t j;
-
- /* now reverse the order of the layers as they are put
- into subimages
- */
- for (j=(ssize_t) number_layers-1; j >= 0; j--)
- AppendImageToList(&image,layer_info[j].image);
- }
-#endif
-
- layer_info=(XCFLayerInfo *) RelinquishMagickMemory(layer_info);
-
-#if 0 /* BOGUS: do we need the channels?? */
- while (MagickTrue)
{
- /* read in the offset of the next channel */
- info->cp += xcf_read_int32 (info->fp, &offset, 1);
-
- /* if the offset is 0 then we are at the end
- * of the channel list.
- */
- if (offset == 0)
- break;
-
- /* save the current position as it is where the
- * next channel offset is stored.
- */
- saved_pos = info->cp;
-
- /* seek to the channel offset */
- xcf_seek_pos (info, offset);
-
- /* read in the layer */
- channel = xcf_load_channel (info, gimage);
- if (channel == 0)
- goto error;
-
- num_successful_elements++;
+ /* NOTE: XCF layers are REVERSED from composite order! */
+ ssize_t j;
- /* add the channel to the image if its not the selection */
- if (channel != gimage->selection_mask)
- gimp_image_add_channel (gimage, channel, -1);
-
- /* restore the saved position so we'll be ready to
- * read the next offset.
+ /* now reverse the order of the layers as they are put
+ into subimages
*/
- xcf_seek_pos (info, saved_pos);
+ for (j=(ssize_t) number_layers-1; j >= 0; j--)
+ AppendImageToList(&image,layer_info[j].image);
}
-#endif
+
+ layer_info=(XCFLayerInfo *) RelinquishMagickMemory(layer_info);
}
(void) CloseBlob(image);