Gimp.register_save_handler('file-ofn-sample-export', 'ofn', '') Img, drawable, filename, raw_filename=args Print 'Called export plugin: %s %s %s %s' % args The selected file gets overwritten and you don't get warned. The select a file that already exists that you don't mind overwriting. The dialog comes up with the Output file field empty. It's called "no-gtk.py" and runs under Gim 2.10 on Windows 10. I have attached a version of my script that does not use 'gtk'. If I can make it work like File>Export, that would be great. But my plug-in does not work the way I want it to when I use the standard file interface. Yes, File>Export seems to work correctly. So if you change your plugin to register as a proper export plugin, when you will be called the file overwrite check will have been already performed by Gimp. If there is a way to configure the standard file chooser to do this, it would certainly make things simpler.Īs far as I can see, the file chooser that Gimp use when you do File>Export already cover this.
#Photo to gcode converter how to#
(02-07-2019, 11:50 PM)Ofnuts Wrote: (02-07-2019, 09:17 PM)DougCoffland Wrote: I used gtk because I couldn't figure out how to get the standard file chooser to warn the user that the file that was selected already exists and to ask the user if they want to replace it. If there is a way to configure the standard file chooser to do this, it would certainly make things simpler.ĭo you have any suggestions on how to do this? I used gtk because I couldn't figure out how to get the standard file chooser to warn the user that the file that was selected already exists and to ask the user if they want to replace it. (02-07-2019, 09:17 PM)DougCoffland Wrote: (02-07-2019, 04:39 PM)Ofnuts Wrote: I don't really understand why you import gtk just to open a FileChooser. There are Python libraries to load images (PIL or its "pillow" derivative, among others).
![photo to gcode converter photo to gcode converter](https://images.sftcdn.net/images/t_optimized,f_auto/p/b88d4ffe-9b24-11e6-8973-00163ed833e7/3886102093/schrift-zu-dxf-und-g-code-screenshot.jpg)
![photo to gcode converter photo to gcode converter](https://media.pcwin.com/images/screen/PPT_to_PDF_Converter_33236.gif)
Otherwise you can just as well make it an independent application and remove the dependency on Gimp.
#Photo to gcode converter registration#
Registration is a bit more complicated that your regular plugin but there are examples (for instance the file-openraster.py plugin that comes in Gimp 2.10). Gimp will then handle the file picker for you. If you want to create a file from the current image, then you define a file-export plugin. (02-07-2019, 04:39 PM)Ofnuts Wrote: I don't really understand why you import gtk just to open a FileChooser.