* plug-ins/common/url.c: if url does not end in a recognized
	extension, open it as an unnamed image.  Fixes bug # 118811.
This commit is contained in:
William Skaggs
2004-06-21 00:48:44 +00:00
parent 707e635f61
commit f68a788d01
4 changed files with 38 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2004-06-20 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/common/url.c: if url does not end in a recognized
extension, open it as an unnamed image. Fixes bug # 118811.
2004-06-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimphistogrambox.[ch]: removed the label between the

View File

@ -143,16 +143,18 @@ load_image (const gchar *filename,
gint wpid;
gint process_status;
gint p[2];
gboolean name_image = FALSE;
fprintf (stderr, "Loading URL: %s\n", filename);
if (!ext || ext[1] == 0 || strchr(ext, '/'))
tmpname = gimp_temp_name ("xxx");
else
{
g_message ("Can't open URL without an extension");
*status = GIMP_PDB_CALLING_ERROR;
return -1;
tmpname = gimp_temp_name (ext + 1);
name_image = TRUE;
}
tmpname = gimp_temp_name (ext + 1);
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -410,7 +412,10 @@ read_connect:
if (image_ID != -1)
{
*status = GIMP_PDB_SUCCESS;
gimp_image_set_filename (image_ID, filename);
if (name_image)
gimp_image_set_filename (image_ID, filename);
else
gimp_image_set_filename (image_ID, "");
}
else
*status = GIMP_PDB_EXECUTION_ERROR;

View File

@ -143,16 +143,18 @@ load_image (const gchar *filename,
gint wpid;
gint process_status;
gint p[2];
gboolean name_image = FALSE;
fprintf (stderr, "Loading URL: %s\n", filename);
if (!ext || ext[1] == 0 || strchr(ext, '/'))
tmpname = gimp_temp_name ("xxx");
else
{
g_message ("Can't open URL without an extension");
*status = GIMP_PDB_CALLING_ERROR;
return -1;
tmpname = gimp_temp_name (ext + 1);
name_image = TRUE;
}
tmpname = gimp_temp_name (ext + 1);
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -410,7 +412,10 @@ read_connect:
if (image_ID != -1)
{
*status = GIMP_PDB_SUCCESS;
gimp_image_set_filename (image_ID, filename);
if (name_image)
gimp_image_set_filename (image_ID, filename);
else
gimp_image_set_filename (image_ID, "");
}
else
*status = GIMP_PDB_EXECUTION_ERROR;

View File

@ -143,16 +143,18 @@ load_image (const gchar *filename,
gint wpid;
gint process_status;
gint p[2];
gboolean name_image = FALSE;
fprintf (stderr, "Loading URL: %s\n", filename);
if (!ext || ext[1] == 0 || strchr(ext, '/'))
tmpname = gimp_temp_name ("xxx");
else
{
g_message ("Can't open URL without an extension");
*status = GIMP_PDB_CALLING_ERROR;
return -1;
tmpname = gimp_temp_name (ext + 1);
name_image = TRUE;
}
tmpname = gimp_temp_name (ext + 1);
if (pipe (p) != 0)
{
g_message ("pipe() failed: %s", g_strerror (errno));
@ -410,7 +412,10 @@ read_connect:
if (image_ID != -1)
{
*status = GIMP_PDB_SUCCESS;
gimp_image_set_filename (image_ID, filename);
if (name_image)
gimp_image_set_filename (image_ID, filename);
else
gimp_image_set_filename (image_ID, "");
}
else
*status = GIMP_PDB_EXECUTION_ERROR;