It is currently Thu Apr 25, 2024 10:15 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Aug 02, 2012 11:51 am  (#11) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
<skip this>....

UPD: Tried on a some new files - it works fine! The message "Last xcf file in directory!" appears at the bottom of the Gimp's main window.

:gimp


Last edited by kobyakov on Thu Aug 02, 2012 12:48 pm, edited 1 time in total.

Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Aug 02, 2012 12:44 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Important for me to choose the file types are *.png, *.tiff, *.jpg, *.bmp, and *.orf (selfishly - the type of camera).

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Aug 02, 2012 2:11 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
MareroQ wrote:
Important for me to choose the file types are *.png, *.tiff, *.jpg, *.bmp, and *.orf (selfishly - the type of camera).


okey dokey-

Give the attached a go.

Menu options are:
File->Sequential->Open First File... This allows you to select a directory and a file type (currently "xcf" "jpg" "bmp" "png" "tiff" and "orf") and will open the first file of that type (case insensitive)
File->Sequential->Open Specific File... This allows you to select a file (currently "xcf" "jpg" "bmp" "png" "tiff" and "orf") and will open that file, setting the sequential filetype to match that file.
File->Sequential->Save and Close then Open Next File This will save, then close the file opened by either of the previous methods (or by this menu item, if called again) then open the next file in the directory of the same filetype. If no files remain a message is generated.

One caveat - if multiple images are open by either of the first two menu items, the "Save and Close then Open Next File" will only continue to work on the last one opened....i.e. the script will not support more than one sequential stream going at a time.

This would probably even more handy if you map a hot key to the save, close and open next item.

While I did this more for the challenge, would this be of value to post up at the plugin registry?

-Rob A>


Attachments:
Sequential_processing.scm [7.23 KiB]
Downloaded 191 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Fri Aug 03, 2012 10:40 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2246
Location: Poland
Thanks.
Once again, thank you very much.
Are you a kind of magician?
I hope you understand that you made some wonderful work making retouchers job a bit easier than it is. Starting from now, they do not have to push a lot of buttons to get through a bunch of files!

Every solution, breaking the theoretical limits, should be disseminated.
Entirely different matter - the matter is an interest in the collection - this is the script for the holders of more files.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Tue Jan 08, 2013 6:02 am  (#15) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
Hi!

MareroQ wrote:
...this is the script for the holders of more files...

Also this is the script for those who have to do the same work on few (tenth or thousands) files. Retouchers etc.

I use this script to retouch my images and it really helps to save time! I must say again :tyspin

I have noticed one thing. Sometime it is necessary to do a quick correction on some file(s) in the directory. Open them again one by one with script is too slow, but when I open files using standart "Open file..." next time the script avoid them.

Is it possible to force the script to run in strict alphabetical order (default sorting in any file browser, I think we all get used to that)?


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Tue Dec 29, 2015 1:16 pm  (#16) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
Hi!

Unfortunately, the script does not work in development version 2.9.3

I changed procedure names according to the gimp error messages, but after opening the first file "save and open again" results in "Last file in directory!" message...

Rob, can I ask you to fix it?


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Tue Dec 29, 2015 4:55 pm  (#17) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
My own implementation in Python. Doesn't work like Rob's so it could be more resilient to v2.9 changes (never tested in on 2.9 though...). Basically it saves the file and looks for a like-named file with the next number in the same directory (so no need to open the first in any special way) and opens it.

_________________
Image


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Tue Dec 29, 2015 6:57 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
kobyakov wrote:
Unfortunately, the script does not work in development version 2.9.3

Try running GIMP using the --pdb-compat-mode on switch.

And FWIW, here is my script for supporting this type of workflow.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Wed Dec 30, 2015 5:51 am  (#19) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
ofnuts: could you provide a link to your script?

saulgoode: I changed procedure names, the script goes through files in directory.
But when it comes to the last file it writes "No image available for sequential edit" and leave the image as is - it does not save it and close. one should manually do it - hit some keys and finalize the sequence. Could you fix it?


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Wed Dec 30, 2015 7:33 am  (#20) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
kobyakov wrote:
ofnuts: could you provide a link to your script?

saulgoode: I changed procedure names, the script goes through files in directory.
But when it comes to the last file it writes "No image available for sequential edit" and leave the image as is - it does not save it and close. one should manually do it - hit some keys and finalize the sequence. Could you fix it?


File is here: http://sourceforge.net/projects/gimp-to ... p/download

_________________
Image


Last edited by ofnuts on Wed Dec 30, 2015 3:53 pm, edited 1 time in total.

Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Wed Dec 30, 2015 11:30 am  (#21) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
kobyakov wrote:
I changed procedure names according to the gimp error messages, ...

Can you post the error messages you receive?

kobyakov wrote:
saulgoode: I changed procedure names, the script goes through files in directory.
But when it comes to the last file it writes "No image available for sequential edit" and leave the image as is - it does not save it and close. one should manually do it - hit some keys and finalize the sequence.

There should only be files left open when you are finished if there were files open before running the script or if there has been an error which occurred while trying to save the file.

kobyakov wrote:
Could you fix it?

I don't have the development version available on my machine at the moment and don't really plan to update my scripts until it can be done against a stable code base.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Wed Dec 30, 2015 12:38 pm  (#22) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
The idea was to went through a bunch of *.xcf images in folder. No matter what the filenames are, we are looking only for the same the extension.

In my workflow the images are named yyy-mm-dd_hh-mm-ss_number.xcf, as usual the "number"'s are not sequential. So the plugin says "No successor found for <filename>". Looks like the plugin is useful only when we have images with ordered filenames.


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Wed Dec 30, 2015 3:56 pm  (#23) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
kobyakov wrote:
The idea was to went through a bunch of *.xcf images in folder. No matter what the filenames are, we are looking only for the same the extension.

In my workflow the images are named yyy-mm-dd_hh-mm-ss_number.xcf, as usual the "number"'s are not sequential. So the plugin says "No successor found for <filename>". Looks like the plugin is useful only when we have images with ordered filenames.


Matter of heuristics... What would be the criteria to find the "next" file? If my script works for you and regular numbered file names on 2.9, it's not hard to make a derivative to support your file name convention.

_________________
Image


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 4:29 am  (#24) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
it's not heuristics, it is just my situation.

it's not about criteria how to find the next file, the idea was to make through all files in directory, no matter what the filenames are. the order in which the files will be open is not important, the critical thing is to not skip any single one and be sure that we make through all of them.

It is all just about to quickly make some tasks on a bunch of files in directory, avoiding unnecessary hitting ctrl+w, ctrl+o, marking the next file and avoid probability of skipping one or some files in rush.

Rob made a good script which I used almost everyday. But now 8-bit editing in stable Gimp is too limiting in my work, so I had to switch to unstable version.


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 4:36 am  (#25) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
saulgoode wrote:
Can you post the error messages you receive?


Looks like the syntax was changed

Gimp 2.8 --> Gimp 2.9
gimp-parasite-find --> gimp-get-parasite
gimp-parasite-attach --> gimp-attach-parasite
etc...


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 5:07 am  (#26) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
kobyakov wrote:
Looks like the syntax was changed

Gimp 2.8 --> Gimp 2.9
gimp-parasite-find --> gimp-get-parasite
gimp-parasite-attach --> gimp-attach-parasite
etc...

Apparently you missed my suggestion to:

Try running GIMP using the --pdb-compat-mode on switch.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 7:18 am  (#27) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
man, I tried it )

error message appear "--pdb-compat-mode=on no such file or directory"

tried to launch gimp from terminal, desktop file, tried to put "--pdb-compat-mode on" and "--pdb-compat-mode=on"... gimp just says that no such file or directory

on the other hand gimp understands --gegl-threads=4 from console and gives no error messages on that


Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 8:26 am  (#28) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2424
kobyakov wrote:
Rob made a good script which I used almost everyday. But now 8-bit editing in stable Gimp is too limiting in my work, so I had to switch to unstable version.


I run a Gimp 2.9.3 in a LinuxMint

I am no coder, just a dabbler,

Got the attached sequential_processing v1.2 working.

worth a try, no guarantees, remember to unzip it


Attachments:
Sequential_processing-2-9-3.scm.zip [2.38 KiB]
Downloaded 97 times

_________________
Image
Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 9:03 am  (#29) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
kobyakov wrote:
it's not heuristics, it is just my situation.

it's not about criteria how to find the next file, the idea was to make through all files in directory, no matter what the filenames are. the order in which the files will be open is not important, the critical thing is to not skip any single one and be sure that we make through all of them.

The scripts don't remember which files have been processed. So knowing in which order things are processed is important (anything before the current file has been done).

_________________
Image


Last edited by ofnuts on Thu Dec 31, 2015 11:49 am, edited 1 time in total.

Top
 Post subject: Re: How to automate saving, closing and opening of images?
PostPosted: Thu Dec 31, 2015 10:52 am  (#30) 
Offline
GimpChat Member

Joined: Jul 31, 2012
Posts: 22
rich2005: Thank you! Your script shows no error messages, but I have the same problem - it does not open next image. Looks like the problem is on my side since I have the same gimp version.

ofnuts: sure, the script must control the situation - i.e. remember which files were open in this session and which are not. suppose there are few ways to do this.


Happy New Year to everybody in this topic! See you next year )


Top
Post new topic Reply to topic  [ 48 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Gimp still running after an hour of closing it down

9

No new posts Attachment(s) how to automate the procedure?

14

No new posts Attachment(s) Automate merge of multiple files horizontally

3

No new posts Can ScriptFu or anything in Gimp automate the creation of layer groups

7

No new posts Attachment(s) GIMP 2.10.12 is not opening on Mac

10



* Login  



Powered by phpBB3 © phpBB Group