Commit f26fb06d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

Bug 559292 – SOTA Chrome cannot accept different textures

2008-11-13  Sven Neumann  <sven@gimp.org>

	Bug 559292 – SOTA Chrome cannot accept different textures

	* app/pdb/gimppdb-utils.c (gimp_pdb_image_is_base_type)
	(gimp_pdb_image_is_not_base_type): gimp_object_get_name() may 
	return NULL for images. Use gimp_image_get_uri() instead.


svn path=/trunk/; revision=27635
parent ee911bdc
2008-11-13 Sven Neumann <sven@gimp.org>
Bug 559292 – SOTA Chrome cannot accept different textures
* app/pdb/gimppdb-utils.c (gimp_pdb_image_is_base_type)
(gimp_pdb_image_is_not_base_type): gimp_object_get_name() may
return NULL for images. Use gimp_image_get_uri() instead.
2008-11-12 Øyvind Kolås <pippin@gimp.org>
* app/gegl/gimpoperationtilesource.c:
......
......@@ -32,6 +32,8 @@
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "file/file-utils.h"
#include "text/gimptextlayer.h"
#include "vectors/gimpvectors.h"
......@@ -385,21 +387,27 @@ gimp_pdb_image_is_base_type (GimpImage *image,
GimpImageBaseType type,
GError **error)
{
gchar *name;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_image_base_type (image) == type)
return TRUE;
name = file_utils_uri_display_basename (gimp_image_get_uri (image));
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Image '%s' (%d) is of type '%s', "
"but an image of type '%s' is expected"),
gimp_object_get_name (GIMP_OBJECT (image)),
name,
gimp_image_get_ID (image),
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE,
gimp_image_base_type (image)),
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE, type));
g_free (name);
return FALSE;
}
......@@ -408,18 +416,24 @@ gimp_pdb_image_is_not_base_type (GimpImage *image,
GimpImageBaseType type,
GError **error)
{
gchar *name;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_image_base_type (image) != type)
return TRUE;
name = file_utils_uri_display_basename (gimp_image_get_uri (image));
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Image '%s' (%d) is already of type '%s'"),
gimp_object_get_name (GIMP_OBJECT (image)),
name,
gimp_image_get_ID (image),
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE, type));
g_free (name);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment