GIMP Python-Fu Export all open images to pdf - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: GIMP Python-Fu Export all open images to pdf (/Thread-GIMP-Python-Fu-Export-all-open-images-to-pdf) |
GIMP Python-Fu Export all open images to pdf - billalmasum93 - 04-01-2022 I want to apply a set of operations on all open images. Then I want to export the modified open images to a pdf. What I tried: https://ideone.com/12JJYf Error I got: https://ideone.com/XCprkE Use some random parameters. RE: GIMP Python-Fu Export all open images to pdf - PixLab - 04-01-2022 file-pdf-save-multi requires an array of image ids and it seems you don't have it (your #comment I did strike shows you tried though) images = gimp.image_list() pdb.file_pdf_save_multi(len(images), images, False, False, False, filename, filename) you should have something alike images = gimp.image_list() images_ids = [img.ID for img in images] pdb.file_pdf_save_multi(len(images), images_ids, False, False, False, filename, filename) https://www.gimpusers.com/forums/gimp-user/14878-cannot-use-function-file-pdf-save-multi there is also an interesting discussion there ➤ http://gimpchat.com/viewtopic.php?f=9&t=12418 RE: GIMP Python-Fu Export all open images to pdf - rich2005 - 04-01-2022 There is a reference to python3 in the error ? Maybe a conflict with Gimp python2.7 RE: GIMP Python-Fu Export all open images to pdf - billalmasum93 - 04-01-2022 (04-01-2022, 04:41 AM)PixLab Wrote: file-pdf-save-multi requires an array of image ids and it seems you don't have it (your #comment I did strike shows you tried though) Thank you, it worked. I was getting error with pdb.gimp_image_list() (04-01-2022, 07:44 AM)rich2005 Wrote: There is a reference to python3 in the error ? Maybe a conflict with Gimp python2.7 Can export now. I mainly needed to know about image.ID it seems. I forgot about it RE: GIMP Python-Fu Export all open images to pdf - Ofnuts - 04-01-2022 Some remarks:
RE: GIMP Python-Fu Export all open images to pdf - Ofnuts - 04-01-2022 (04-01-2022, 04:41 AM)PixLab Wrote: you should have something alikeThis programming teacher says that there is a big bug in the making, because you are assuming that images and image_ids have the same length, and this can become false later on (for instance if you filter ilages on type/name/whatever). RE: GIMP Python-Fu Export all open images to pdf - billalmasum93 - 04-01-2022 (04-01-2022, 08:41 PM)Ofnuts Wrote:(04-01-2022, 04:41 AM)PixLab Wrote: you should have something alikeThis programming teacher says that there is a big bug in the making, because you are assuming that images and image_ids have the same length, and this can become false later on (for instance if you filter ilages on type/name/whatever). That can be a bug. I will switch to len(image_ids) and image_ids=[image_id for image_id in image_ids if image_id is not none] Although in my case it shouldn’t make any difference. The reason is I will always apply same set of operations on all valid open pages and no pages will be deleted RE: GIMP Python-Fu Export all open images to pdf - billalmasum93 - 04-02-2022 (04-01-2022, 08:37 PM)Ofnuts Wrote: Some remarks: These are useful for me so I will go through each of them. * I saved all open images because I did not know any other way of accessing the images after modifying them. Please let me know if there is a better way. * I was wondering whether to keep it or not, I kept it initially because I was experimenting the noise effect with a single image. * I initially did that inside the loop but then I saw in another post on stackexchange I think where someone said a single undo is enough so did this. * I wanted to access the opacity/radius parameter that is used for different blur/noise effects. Opacity can be configured within plugins whereas radius has to be configured outside the plugin. Please let me know if there is a reliable way to do this. I didn't find the official documentation particularly self-containing for API information. RE: GIMP Python-Fu Export all open images to pdf - Ofnuts - 04-03-2022 (04-02-2022, 03:46 PM)billalmasum93 Wrote:(04-01-2022, 08:37 PM)Ofnuts Wrote: Some remarks:
|