TL;DR:如何使用 Python 在 Gimp 中打开图像,就像使用 (File->Open) 一样,以获得Overwrite file.png
选项并避免Save the changes to image 'sample.png' before closing?
对话框。
我为 Gimp 编写了一个 Python 脚本,它对选定区域进行了一些修改,然后将其保存为 PNG。之后,我想打开文件,以便用户可以检查一切是否正确或更改某些内容。由于插件的用户不一定知道如何使用 Gimp,因此"Save the changes to image 'sample.png' before closing?"
对话框可能会令人困惑。
我目前使用的方法是
pdb.file_png_save(image, drw, new_file, new_file,0,9,0,0,0,0,0)
gimp.Display(pdb.gimp_file_load(new_file, new_file))