Python Plug In file-heif-save - 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: Python Plug In file-heif-save (/Thread-Python-Plug-In-file-heif-save) |
Python Plug In file-heif-save - Julio85 - 09-06-2018 I´m trying to use that Python PlugIn and it doesn´t work, maybe I´m doing something wrong or introducing wrong parameters. I need an example to make it work. I´m using the last version GIMP 2.10.6 pdb.file_heif_save(image, drawable, uri, raw_uri, quality, lossless) Thanks in advance. RE: Python Plug In file-heif-save - rich2005 - 09-06-2018 AFAIK the plugin does not export, only open. I think there is a bug report about that. The progress report bottom of Gimp window show an export but no file is produced. These 2 made with the heif linux encoder, lenna-100 is lossless lenna-50 is 50% quality setting So an example of code might not be any use. RE: Python Plug In file-heif-save - rich2005 - 09-06-2018 I am wrong, Gimp does indeed save a .heif file, any old problems are fixed. (although not in my linux flatpak) So what you need is one of the clever guys to advise on the syntax. run-mode INT32 The run mode { RUN-NONINTERACTIVE (1)} image IMAGE Input image drawable DRAWABLE Drawable to export filename STRING The name ofthefile to export the image in raw-filename STRING The name of the file to export the image in quality INT32 Quality factor (range: 0-100. 0 = worst. 100 = best) lossless INT32 Use lossless compression (0 = lossy 1 = lossless) I thought I might get this working in BIMP but it comes unstuck with the filename parameters. RE: Python Plug In file-heif-save - Julio85 - 09-06-2018 Yes! I need one of the clever guys for an example. This is the error that appear in Python Console: Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: wrong parameter type Thanks for your answer!! RE: Python Plug In file-heif-save - Ofnuts - 09-06-2018 You are lucky, what I get from that plugin is: Code: /app/lib/gimp/2.0/plug-ins/file-heif/file-heif: fatal error: Segmentation fault (whether I try to call it in a script or use File/Export in the UI) Now, I can't even find a HEIC image to download to attempt to open it. RE: Python Plug In file-heif-save - jmarcorb - 09-08-2018 I was trying to use this plugin from external command line but could not figure it out. Luckily I found http://beefchunk.com/documentation/lang/gimp/GIMP-Scripts-Fu.html#convertpng-script-fu With this finally I understood how to call this plugin, this is, not directly but via another script. For me it worked creating and registering my own script that used file-heif-save, after that it was just a matter of executing from bash, as shown in the link. Using the great scripts developed by David M. MacMillan (thanks for sharing under GNU GPL), like dmmConvertPNGtoJPG, I changed bits and pieces so that script used file-heif-save instead of file-jpeg-save. Later it was a matter of placing it in GIMP scripts folder, refreshing GIMP's script-fu scripts, and calling the registered script from bash shell. convertJPGtoHEIF.scm: Code: (define (convertJPGtoHEIF infile outfile) Code: gimp -c -i -d -b "(convertJPGtoHEIF \"image2.jpg\" \"image2.heif\")" "(gimp-quit 0)" Hope it helps . RE: Python Plug In file-heif-save - Julio85 - 09-10-2018 THANK YOU SO MUCH!!! IT WORKS!! |