* 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> 2004-06-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimphistogrambox.[ch]: removed the label between the * app/widgets/gimphistogrambox.[ch]: removed the label between the

View File

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

View File

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

View File

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