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
This commit is contained in:
Sven Neumann 2008-11-13 08:21:00 +00:00 committed by Sven Neumann
parent ee911bdcf9
commit f26fb06dbc
2 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,11 @@
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:

View File

@ -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;
}