You are here

Automatic backup of open images

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
AttachmentSize
autosave_a_3.zip26.46 KB

Thanks to 'RobA' who discussed this topic here recently, the Python plug-in 'autosave.py' attracted my attention. My work inspired by it is included below.
What I think is new here from the three existing one, that I know. It has a configuration section and the possibility to stop it, so you can restart with a new purpose (configuration) or not.

After an extraction of the zip archive in the '.../.gimp-2.x/plug-ins' directory it should appears in GIMP under the menu: "(Image)/Extensions/Plugins-Python/File/Autosave...".
Please dock the error console before running 'autosave_a'. A good idea is to have it always open.

Edit_3 [2012/06/06]: corrected a behavior bug (keeps saving after a close window) and added some improvements in the preset department.
Edit_4 [2012/07/12]: Avoiding to pass, if possible, the name 'Untitled' given to imported images in GIMP-2.8.0 to the backup file. Acting on the suggestion of 'Derelicht' with a new procedure 'noUI_autosave_a' included in the file 'autosave_a.py'.
Edit_5 [2012/07/15]: Made 'autosave_a' aware of 'noUI_autosave_a' and patch a control freak bug. The bug was the possibility of multiple instances of 'noUI_autosave_a'; a low visibility plug-in with minimal control. This complete version 0.2 which started with Edit_3.

Edit_6 [2012/12/17]: beginning of version 0.3
a) Check folder and file existence, following a small patch to avoid a crash when a backup file was remove during execution. Also 'noUIautosave_a' will alway save somewhere.
b) The old 'autosave.cfg' file is no longer used because the name of the dictionary key have been made more meaning full, sorry.
c) It should now gives a warning in the 'Error Console' if another instance of 'autosave_a' is running.
d) Some small tweaks to the user interface like using language translation to change menu placement, etc.
In the attachment 'autosave_a_3.zip'.
Edit_7 [2013/01/12]: Gives free space info after changing the folder or starting 'autosave_a'.
In the attachment 'autosave_a_3.zip'.
Edit_8 [2013/02/24]: continuation on the theme of version 0.3 : what can go wrong without intent?
a) Change in the function call to 'change dir.', so only folder can be accessed.
Also the former function was deprecated in GTK.
b) Terminating when there is no free space left.
c) More graceful automatic error terminations.
d) Debug: special characters (non ASCII) in the Windows file system work with the plug-in now;
tested on Jernej Simončič's 2.8.4 build.
In the attachment 'autosave_a_3.zip'.
Edit_9 [2013/02/28] :
Debug of the label color scheme
Debug the 'noUIautosave_a' automatic error termination.
Edit_10 [2013/10/25] :
Encounter a similar problem as was mentioned in 'Comments: plugin crashing' in 'openSUSE 12.3' which was solved by this update version. This terminate version 0.3. [2013/10/27] Sorry, included a faulty file, retry now!

Bye, Robert

Code License: 
GIMP Version: 
Scripting Engine: 

Comments

i see but is the first the most important for me i need something to save or export at each change

Here is my take of where to ask for a chance to have your wish:

The direct approach of saving the change image to disk will not work well because change to an image happens faster on average than the time needed for saving. So the saving buffer will overloaded after a certain number of changes.
Fastest is saving changes to RAM and GIMP already does that in the 'History' buffer so an access to it is needed. But the interpreted languages like Scheme or Python don't have that, I think.
It seems a C or C++ programmer with a working knowledge of the 'History' buffer is your best bet to save the image with the 'History' buffer intact before it recycle! (Should probably be a large improvement in GIMP to have saving and loading *.xcf file with 'History' ?)

This is a brilliant solution!
Thank You very much.

A pat on the back is appreciated from time to time. But it is not a perfect plug-in if such a thing exist.
For example I was surprise to discover accidentally that you can have many instances of it running simultaneously. Not sure if is a feature or a bug, but at least the user should be warned if there is one already running, which is not implemented because I don't know how!
Nevertheless hopes it is pleasant to use, if you find other bug(s) or small improvement please report them here.

Would it be possible to make a version of this script that starts at program startup? You know, like a "Set it and forget it" configuration?

The extension of the flexibility of this plug-in in that direction should be possible even it's not the main goal.
A general way is a shell script with a main command line like:
...
gimp [~/Images/name] -b '(python-fu-autosave-a RUN-INTERACTIVE 1 0)'
...
In a Linux terminal, actual plug-in and interactive mode; this has worked for me.
It launch GIMP-2.8, the 'filename' image and the plug-in with interface. If you are on Windows do an equivalent 'bat' file, but I don't remember how.

If you want to have 'RUN-NONINTERACTIVE', for many starts of GIMP ("Set it and forget it" configuration). It might be possible with a a modification of the actual one. Or a new version of the plug-in may be necessary. I have to investigate, but it will use a similar shell script.

Thanks for the suggestion.

Pages

Subscribe to Comments for "Automatic backup of open images"