gimp_image_set_file(): allows .jpg initially, but not when called by plug-in
- GIMP version: 2.99
- Operating System: linux
Initially, when I load a jpeg, get_path points to the file I loaded it from:
img.get_file().get_path()
'/home/akkana/Images/2023/atalaya/PXL_20230920_181601862.jpg'
But if I want to change that from a plug-in:
img.set_file(Gio.File.new_for_path('/home/akkana/Images/2023/atalaya/foo.jpg'))
False
In the terminal, I see:: gimp_image_set_file: failure to set file 'file:///home/akkana/Images/2023/atalaya/foo.jpg' with extension 'jpg'. The extension must be '.xcf'.
Why? If the image's file could never be non-XCF I could understand it. But it was .jpg before, so why can't I change it to a different .jpg?
This is also a regression for plug-in authors: it was possible in 2.x, and in git master some six months ago, to set an image's file to a .jpg.
It is sometimes useful to know what file is associated with an image even if it hasn't been saved to an XCF, and to be able to change the basename that shows in the titlebar.