<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>gimp_image_add_layer deprecated in gimp 2.7/2.8</title>
		<link>http://liquidrescale.wikidot.com/forum/t-422108/gimp-image-add-layer-deprecated-in-gimp-2-7-2-8</link>
		<description>Posts in the discussion thread &quot;gimp_image_add_layer deprecated in gimp 2.7/2.8&quot; - add_layer needs to be changed to insert_layer</description>
				<copyright></copyright>
		<lastBuildDate>Tue, 18 Aug 2026 07:31:13 +0000</lastBuildDate>
		
					<item>
				<guid>http://liquidrescale.wikidot.com/forum/t-422108#post-1433075</guid>
				<title>Re: gimp_image_add_layer deprecated in gimp 2.7/2.8</title>
				<link>http://liquidrescale.wikidot.com/forum/t-422108/gimp-image-add-layer-deprecated-in-gimp-2-7-2-8#post-1433075</link>
				<description></description>
				<pubDate>Mon, 30 Apr 2012 16:48:25 +0000</pubDate>
				<wikidot:authorName>CarloB</wikidot:authorName>				<wikidot:authorUserId>39255</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi and thanks for the heads-up and the patch. After a long time, I have finally had the time to try using the latest GIMP development versions, but I can't see any of the error messages you mention. Furthermore, I'm afraid that applying the patch will break compatibility with GIMP 2.6, so I'm keeping this in mind but I'm not adopting the new API for the time being.<br /> Let me know if the problem is still present.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://liquidrescale.wikidot.com/forum/t-422108#post-1330693</guid>
				<title>gimp_image_add_layer deprecated in gimp 2.7/2.8</title>
				<link>http://liquidrescale.wikidot.com/forum/t-422108/gimp-image-add-layer-deprecated-in-gimp-2-7-2-8#post-1330693</link>
				<description></description>
				<pubDate>Sun, 18 Dec 2011 20:12:26 +0000</pubDate>
				<wikidot:authorName>Sven Lankes</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I've noticed that gimp 2.7 throws an ugly error-dialog stating that gimp-image-add-layer<br /> is deprecated everytime the plugin tries to add a layer. I've fixed this for the fedora<br /> package of the liquid-rescale-gimp-plugin by replacing the function calls using<br /> the following patch:</p> <div class="code"> <pre><code>diff --git a/src/io_functions.c b/src/io_functions.c index 20917df..b159ed8 100644 --- a/src/io_functions.c +++ b/src/io_functions.c @@ -227,7 +227,7 @@ write_vmap_to_layer (LqrVMap * vmap, gpointer data) gimp_layer_new (image_ID, name, w, h, GIMP_RGBA_IMAGE, 100, GIMP_NORMAL_MODE); gimp_drawable_fill (seam_layer_ID, GIMP_TRANSPARENT_FILL); - gimp_image_add_layer (image_ID, seam_layer_ID, -1); + gimp_image_insert_layer (image_ID, seam_layer_ID, -1, -1); gimp_layer_translate (seam_layer_ID, x_off, y_off); if (seam_layer_p) { diff --git a/src/layers_combo.c b/src/layers_combo.c index 10d810e..e032eed 100644 --- a/src/layers_combo.c +++ b/src/layers_combo.c @@ -199,7 +199,7 @@ callback_new_mask_button (GtkWidget * button, gpointer data) gimp_layer_new (p_data-&gt;image_ID, nl_data-&gt;name, p_data-&gt;old_width, p_data-&gt;old_height, image_type, 50, GIMP_NORMAL_MODE); - gimp_image_add_layer (p_data-&gt;image_ID, layer_ID, -1); + gimp_image_insert_layer (p_data-&gt;image_ID, layer_ID, -1, -1); gimp_drawable_fill (layer_ID, GIMP_TRANSPARENT_FILL); gimp_layer_translate (layer_ID, p_data-&gt;x_off, p_data-&gt;y_off); gimp_image_undo_group_end (p_data-&gt;image_ID); diff --git a/src/render.c b/src/render.c index f50fc8c..b7e8c7e 100644 --- a/src/render.c +++ b/src/render.c @@ -172,7 +172,7 @@ render_init_carver (PlugInImageVals * image_vals, { g_snprintf (new_layer_name, LQR_MAX_NAME_LENGTH, &quot;%s LqR&quot;, layer_name); layer_ID = gimp_layer_copy (layer_ID); - gimp_image_add_layer (image_ID, layer_ID, -1); + gimp_image_insert_layer (image_ID, layer_ID, -1, -1); gimp_drawable_set_name (layer_ID, new_layer_name); gimp_drawable_set_visible (layer_ID, FALSE); } @@ -181,7 +181,7 @@ render_init_carver (PlugInImageVals * image_vals, image_ID = gimp_image_new (old_width, old_height, gimp_image_base_type(image_ID)); gimp_image_undo_group_start(image_ID); layer_ID = gimp_layer_new_from_drawable (layer_ID, image_ID); - gimp_image_add_layer (image_ID, layer_ID, -1); + gimp_image_insert_layer (image_ID, layer_ID, -1, -1); gimp_layer_translate(layer_ID, -x_off, -y_off); gimp_drawable_set_visible (layer_ID, TRUE); if (vals-&gt;resize_aux_layers) @@ -858,7 +858,7 @@ static gboolean copy_aux_layer_to_new_image (gint32 image_ID, gint32 * layer_ID_ if (old_layer_ID) { new_layer_ID = gimp_layer_new_from_drawable (old_layer_ID, image_ID); - gimp_image_add_layer (image_ID, new_layer_ID, -1); + gimp_image_insert_layer (image_ID, new_layer_ID, -1, -1); /* gimp_drawable_offsets (old_layer_ID, &amp;aux_x_off, &amp;aux_y_off); */ gimp_layer_translate (new_layer_ID, -x_off, -y_off); }</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>