Autosave

Periodically saves any open files in the current GIMP instance.

I got tired of searching for GIMP autosave and coming across developer discussions stating, in essence why autosave won't be implemented.

Installs a menu under <Image>/File/Autosave, containing "Enable", "Disable" and "Settings". From the settings dialog, you can enable/disable autosave globally, set the interval in minutes, and configure the location and pattern for autosave files of new and saved files individually. You can also edit the "autosave.conf" file in the same directory as the plugin script. Requires libgimp-perl and gtk2-perl. There is the standard version (autosave.pl), and one that prints debug messages on almost every operation (autosave.dbg.pl).

To use, simply download either the standard or debug version of the script to your plug-in directory (.gimp-$version/plug-ins on linux, don't know about other OSes)

There are some considerations:

  • Currently, only one running instance is supported (that is, enabling/disabling autosave will enable/disable it for all GIMP processes).
  • Per-image enable/disable is not currently incorporated
  • I've only tested it on GIMP 2.6.7 and 2.7 on linux. I'd appreciate it, if anyone used this on any other version/OS, if you'd let me know if i works as advertised
  • I could find no reliable way for it to start working automatically, i.e., without you having to do extra, so you have to do one of three things:
    • Whenever you start gimp, click File/Autosave/Enable
    • Start gimp from the command line, or write a small wrapper script with the command gimp -b "(autosave 1)"
    • Find gimp.desktop application file that your Desktop Environment use, and change the Exec=gimp %F (or gimp %U) line to Exec=gimp -b "(autosave 1)" %F (or gimp -b "(autosave 1)" %U)

Feedback/Suggestions are welcome.

Edit: It somehow slipped me that all distros are not equal. If you can't find the perl gimp package on your installation, install the Gimp package using CPAN. From the command line I believe that goes cpan install Gimp, or just browse to the module page and follow the install instructions there. You'll need to make sure that the location it installs to is in perl's @INC variable (like $PATH for perl), or move it to a directory that is in @INC. You can find out which directories are searched by typing at the command line perl -e 'print join "\n", @INC'.

Again, if anyone has any problems using this please feel free to ask, and I'll do what I can to assist. I'm especially interested to know how this works (if at all) on non-linux OSes.

AttachmentSize
autosave.pl13.26 KB
autosave.dbg_.pl14.89 KB
0
Average: 4.8 (4 votes)

Comments

Thanks much!

Listen, you have no idea how much I appreciate you being willing to help a noob like myself.

No Problem

No Problem at all.

I sent you a message with my contact info via the contact form. If you don't see it, please check to make sure it didn't end up in spam.

Windows version?

Could someone make a Windows version of this, or is there a way to get the perl stuff for Windows XP?

Should be able

Should be able to get it to work. You can download perl for windows from here and then use CPAN to download the packages you need. You'll need the Gimp and Gtk2 perl modules and I think you'll need to download GTK for windows from here. Now I haven't had a windows install for some time now and I'm not really falling over myself to set one up, but if you have the time, I'd be willing to help get it working.

Regards, rain.

edit: Actually come to think of it, the GTK+ runtime gets installed with GIMP IIRC, so it's just perl and the perl modules you need to worry about.

Uhhhh

Yeah, i could use the help, because, I have absolutely no idea where to put perl stuff on a Windows installation. Heh. That's how new I am, but, I'm sick of GIMP eating stuff at my processor's expense and losing my work.

Sure

No problem, I'll be with you in just a sec

Plug-in Doesn't Work!

I have downloaded the autosave plug-in, and have installed it in the proper plug-ins directory. When I start gimp as suggested (gimp -b "(autosave 1)" from a command line), I get an error message saying it can't find Gimp.pm in the INC directories, and the "Auto Save" function doesn't show up in the file menu. I'm using Gimp 2.6.8 and perl 5.10.0 on a Fedora 12 Linux 64-bit (kernel 2.6.31.12-174.2.22.fc12.x86_64) system.

Any help/advice you can provide would be greatly appreciated.

Thanks!

Regards, Chris

Edit: I checked and, indeed, there is no Gimp.pm on my system. Am I missing a package or something? I tried doing "yum provides */Gimp.pm" but came up empty handed. What am I missing???

Thanks, again... Chris

Installing gimp-perl in fedora 12

Hi Chris
I'm running Fedora 12 , 64 bit too and I'm interested to know how you managed to install gimp-perl for the latest version of Gimp. I've been trying to find the source but the latest version I can find is version 2.2. I'm guessing you are using Gimp.2.6...?

Any help would be greatly appreciated

Hayley

Try this...

Glad to see some interest in this plug-in, hope it proves useful. In debian, the package is libgimp-perl. I did a quick search and I think the package you want is gimp-perl. Let me know If you get it to work.

Thank you!!!

Thank you, Mesach, for your help in getting the plug-in working... VERY much appreciated!

For the record, the problem with with my installation of GIMP and Gimp.pm, NOT Mesach's script. He spent a great deal of time with me on MSN IM diagnosing the problem and getting it fixed. The script now works flawlessly, and I *love* it!

Regards, Chris

No Problem

No problem at all, Chris. Glad to hear it helps you. One of the things that made me really appreciate having done this was that I could download the bleeding edge gimp from git and use that instead. There are a few things that make it unlikely I'll go back to gimp-2.6. So give it a whirl (instructions: http://www.shallowsky.com/linux/gimpbuild.html). A few times it crashed and I literally laughed out loud because I didn't lose more than a couple minutes' work and I felt like I beat it somehow.

rain

Thanks for the reply, rain.

Thanks for the reply, rain. After much fumbling and gnashing of teeth, I did manage to *finally* install Gimp.pm using CPAN. Now, the original error message has disappeared... WOO HOO! However, we're not out of the woods yet, as I'm now getting *this* error message:

[root@localhost /usr/src/Gimp-2.0]# gimp -b "(autosave 1)"
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
batch command experienced an execution error

I do notice that I'm getting the "Did not receive a reply..." error when I run GIMP without loading autosave (e.g. typing "/usr/bin/gimp" on the command line, so what we're dealing with here is the "batch command experienced an execution error" message.

Any ideas how to fix this???

Btw, I removed the original autosave_4.pl file, downloaded the autosave.dbg__6.pl file and saved it to the plug-ins directory under the name autosave.pl but that didn't fix anything nor did I get any debugging info. Am I doing something wrong? (I'm hoping to get you more info than "batch command experienced an execution error." ;)

Edit: After some further research, I noticed that "autosave.pl" isn't in my pluginrc file. So, I deleted the file and ran gimp to rebuild it. The script *still* isn't in the pluginrc file, even though it did recognize all the Python scripts (i.e. (*.py). Is there something I need to do to get gimp to recognize Perl scripts?

Regards, Chris

P.S. Sorry for the lengthy delay in responding to your reply... I had problems logging into the Registry.

Great Feature

Great feature

How to use these scripts for auto save

How to use these scripts for auto save?
Please specify anyone......please........
Please step by step guide lines anyone.........here.......I am not the Computer Insect I mean I don't have enough information to use these scripts?

How to install

Sorry for leaving that bit out. Just copy the script to your plug-ins directory. You'll need the PerlServer extension (comes bundled with gimp in debian/linux in general, but I'm not sure about any other env). HTH.

Has anyone got this to work in windows yet?

Has anyone got this to work in windows yet? I got a link from a friend to dl camelbox here
http://code.google.com/p/camelbox/downloads/list

Still cant get it to work though.Do i need to change the path in the autosave_4.pl file?

Syndicate content