plug-ins: allow running file-raw-data non-interactively.
The code was perfectly working already, yet we were blocking the non-interactive case only to stop automatic runs, such as generating thumbnails. The chosen solution is not perfect either as it would break on the odd case where a given raw data file's expected dimensions were the default. Yet it's a start.
This commit is contained in:
@ -629,12 +629,27 @@ raw_load (GimpProcedure *procedure,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* we only run interactively due to the nature of this plugin.
|
gint width;
|
||||||
* things like generate preview etc like to call us non-
|
gint height;
|
||||||
* interactively. here we stop that.
|
|
||||||
|
g_object_get (config,
|
||||||
|
"width", &width,
|
||||||
|
"height", &height,
|
||||||
|
NULL);
|
||||||
|
/* This is a very crappy way to stop GIMP from automatic runs,
|
||||||
|
* e.g. when generating previews (which usually makes no sense on
|
||||||
|
* raw data files as we can't guess the actual width/height).
|
||||||
|
* Unfortunately it means that we also break the odd case when one
|
||||||
|
* had a file which used exactly the PREVIEW_SIZE for both
|
||||||
|
* dimensions by chance! We will have to handle this better.
|
||||||
|
* FIXME!
|
||||||
*/
|
*/
|
||||||
|
if (width == PREVIEW_SIZE && height == PREVIEW_SIZE)
|
||||||
|
{
|
||||||
|
/* TODO: set an error message after the string freeze. */
|
||||||
status = GIMP_PDB_CALLING_ERROR;
|
status = GIMP_PDB_CALLING_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* we are okay, and the user clicked OK in the load dialog */
|
/* we are okay, and the user clicked OK in the load dialog */
|
||||||
if (status == GIMP_PDB_SUCCESS)
|
if (status == GIMP_PDB_SUCCESS)
|
||||||
|
Reference in New Issue
Block a user