How can I set the number of layers of thumbnail?
Hi!
I'm writing this plug-in for GIMP-2.6 on Fedora 9.
http://registry.gimp.org/node/9036
I added ability to load as a thumbnail but it only showed file name
and file size in preview box of save dialog.
I want to show more information such like image width, height, and
number of layers.
I modify these lines based on "libgimpthumb/gimpthumbnail.c"
query (void)
{
//////////////////////////////
static const GimpParamDef thumb_return_vals[] =
{
{ GIMP_PDB_IMAGE, "image", "Thumbnail image" },
{ GIMP_PDB_INT32, "image-num-layers", "The number of layers" },
{ GIMP_PDB_INT32, "image-width", "The width of image" },
{ GIMP_PDB_INT32, "image-height", "The height of image" }
};
///////////////////////////////
run (name,
///////////////////////////////
else if (strcmp (name, LOAD_THUMB_PROC) == 0)
{
image_ID = load_thumbnail (param[0].data.d_string, &nlayers, &error);
if (image_ID != -1)
{
*nreturn_vals = 5;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_ID;
values[2].type = GIMP_PDB_INT32;
values[2].data.d_int32 = 666; /* image-num-layers */
values[3].type = GIMP_PDB_INT32;
values[3].data.d_int32 = 777; /* image-width */
values[4].type = GIMP_PDB_INT32;
values[4].data.d_int32 = 888; /* image-height */
}
////////////////////////////
(Full source code is here. http://www.sutv.zaq.ne.jp/linuz/tks/item/file-xmc.c )
The result is here.
http://www.sutv.zaq.ne.jp/linuz/tks/item/preview.png
If things go well, preview showld become
777 x 888 pixels
666 layers
but actual result is
666 x 777 pixels
It seems that "image-num-layers" is ignored!
Then, how can I set the number of layers for a thumbnail?
Or, is it impossible?
I also tried to read "app/widgets/gimpthumbbox.c", but it's a hard work...
tks