It is currently Sat Aug 15, 2026 10:02 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Gimp "user-exits"
PostPosted: Sat Jun 15, 2013 12:37 pm  (#1) 
Offline
GimpChat Member

Joined: Feb 22, 2012
Posts: 295
Location: Germany
I modified my gimp again...
Gimp can handle EXIF/XMP information only from .jpg files.
Normally, other file formats do not have EXIF information, except TIF.
Because I use gimp as a photo editor, this is an annoying case, because my lightroom exports
files as tif for modifying them in gimp. In the exported tif files, the EXIF information is present,
after modifying the tif in gimp, the EXIF information is lost.
So I decided to modify my gimp-2.8.5 in a way that it calls plug-ins as a kind of "user-exit".
It calls
plug-in-before-load: just before a file is loaded. The filename is already known. Transferred to the plug-in is the filename.
plug-in-after-load: just after a file is loaded. Transferred to the plugin is the filename and the image. Furtheron the information, if the loading process was successful, cancelled or errornous.
plug-in-before-save: just before the image is saved, exported or overwritten. The new filename is already known.
Transferred to the plugin is the image, the new filename and the "original" filename that the file had, when it was loaded.
plug-in-after-save: just after saving the file. Transferred to the plugin is the filename, the "original" filename and the image. Furtheron the information, if the saving process was successful, cancelled or errornous.
The plug-ins can be realized as python plugins, but I don't see, why they can't be realized as C compiled plugins.

I realized them as python plugins.
In plug-in-before-load I call a (windows) exiftool command, which saves my EXIF data to a file.
In plug-in-after-save I call exiftool again to import the exif data into my saved file again.
So I can preserve the EXIF information from a tif file and import them back to the saved tif file.
I'm aware of the fact that the EXIF information may not be valid anymore.

Attached are the patch files for the gimp-2.8.5 source. The plug-ins will not be copied to the plug-ins directory, because if they are not present, they will not be called, so gimp behaves as usual. Only if you want to use them, they must be copied to the plug-ins directory.
I will not propose that patch to the official gimp developers. The developers would call this a "more than a creepy hack".


Attachments:
user-exits-gimp-2.8.5.zip [4.28 KiB]
Downloaded 147 times
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group