"The run mode: RUN_INTERACTIVE (0) or RUN_NONINTERACTIVE (1)"
},
{
PDB_STRING,
"filename",
"The name of the file to load"
},
{
PDB_STRING,
"raw_filename",
"The name entered"
}
};
static ProcArg file_load_outargs[] =
{
{
PDB_IMAGE,
"image",
"The output image"
}
};
static ProcRecord file_load_proc =
{
"gimp_file_load",
"Loads a file by extension.",
"This procedure invokes the correct file load handler according to the file's extension and/or prefix. The name of the file to load is typically a full pathname, and the name entered is what the user actually typed before prepending a directory path. The reason for this is that if the user types http://www.xcf/~gimp/ he wants to fetch a URL, and the full pathname will not look like a URL.",
"The run mode: RUN_INTERACTIVE (0) or RUN_NONINTERACTIVE (1)"
},
{
PDB_IMAGE,
"image",
"Input image"
},
{
PDB_DRAWABLE,
"drawable",
"Drawable to save"
},
{
PDB_STRING,
"filename",
"The name of the file to save the image in"
},
{
PDB_STRING,
"raw_filename",
"The name of the file to save the image in"
}
};
static ProcRecord file_save_proc =
{
"gimp_file_save",
"Saves a file by extension.",
"This procedure invokes the correct file save handler according to the file's extension and/or prefix. The name of the file to save is typically a full pathname, and the name entered is what the user actually typed before prepending a directory path. The reason for this is that if the user types http://www.xcf/~gimp/ she wants to fetch a URL, and the full pathname will not look like a URL.",
"The name of the file that owns the thumbnail to load"
}
};
static ProcArg file_load_thumbnail_outargs[] =
{
{
PDB_INT32,
"width",
"The width of the thumbnail"
},
{
PDB_INT32,
"height",
"The height of the thumbnail"
},
{
PDB_INT32,
"thumbnail_data_count",
"The number of bytes in thumbnail data"
},
{
PDB_INT8ARRAY,
"thumb_data",
"The thumbnail data"
}
};
static ProcRecord file_load_thumbnail_proc =
{
"gimp_file_load_thumbnail",
"Loads the thumbnail for a file.",
"This procedure tries to load a thumbnail that belongs to the file with the given filename. This name is a full pathname. The returned data is an array of colordepth 3 (RGB), regardless of the image type. Width and height of the thumbnail are also returned. Don't use this function if you need a thumbnail of an already opened image, use gimp_image_thumbnail instead.",
"Adam D. Moss, Sven Neumann",
"Adam D. Moss, Sven Neumann",
"1999-2000",
PDB_INTERNAL,
1,
file_load_thumbnail_inargs,
4,
file_load_thumbnail_outargs,
{ { file_load_thumbnail_invoker } }
};
static Argument *
file_save_thumbnail_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
gchar *filename;
TempBuf *thumb;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
filename = (gchar *) args[1].value.pdb_pointer;
if (filename == NULL)
success = FALSE;
if (success)
{
thumb = make_thumb_tempbuf (gimage);
if (file_save_thumbnail (gimage, filename, thumb))
"This procedure saves a thumbnail in the .xvpics format for the given image. The thumbnail is saved so that it belongs to the file with the given filename. This means you have to save the image under this name first, otherwise this procedure will fail. This procedure may become useful if you want to explicitely save a thumbnail with a file.",
"Josh MacDonald",
"Josh MacDonald",
"1997",
PDB_INTERNAL,
2,
file_save_thumbnail_inargs,
0,
NULL,
{ { file_save_thumbnail_invoker } }
};
static Argument *
temp_name_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gchar *extension;
gchar *name = NULL;
static gint id = 0;
static gint pid;
extension = (gchar *) args[0].value.pdb_pointer;
if (extension == NULL)
success = FALSE;
if (success)
{
if (id == 0)
pid = getpid();
name = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimp_temp.%d%d.%s",