GNOME Bugzilla – Bug 110242
want option to edit files from cmd line sequentially, instead of all at once
Last modified: 2018-05-24 10:50:04 UTC
The thing I use Gimp for most often is doing minor edits of photos I've taken with a digital camera (cropping, color correction, etc.) I wish there was a way to do something like gimp --sequential *.jpg and have Gimp open up 001.jpg, and let me edit it; and then, when I save that file and close its window, *only then* open up 002.jpg; and so on for each file specified on the command line. Obviously, when dealing with hundreds of files, I can't just open them all at once: that makes my machine thrash into the ground. But, opening them one after another using File/Open is a huge pain, since I have to scroll progressively further with each file after the ~10th, since the Open dialog doesn't remember the last scroll position, I always lose track of which number I'm on. It's really easy to do what I want using "xv", if all I care about doing is cropping and resizing; but I often need the power of Gimp's Levels dialog, which xv doesn't do well at all. What do you think? Perhaps there's some simple script-y way to do this -- if there is, I'd sure like to know it! I'm using 1.2.3.
Changes at the request of Dave Neary on the developer mailing list. I am changing many of the bugzilla reports that have not specified a target milestone to Future milestone. Hope that is acceptable.
Doesn't smell like easy to implement - settting target milestone to Future.
When I submitted this bug, I guess I didn't know about gimp-remote. I wrote an tiny sh script called "gimploop" that does this; the problem with it is that I have to keep going back to the shell window and hitting RET to get the next file (whereas I was hoping for a solution that caused the next file to pop up automatically when I saved/closed the file I was currently working on.) #!/bin/sh for file in $* ; do if [ "`pidof gimp`" = "" ]; then echo "launching gimp..." gimp >/dev/null 2>&1 & sleep 10 fi echo -n "$file..." gimp-remote $file read line done
Just use: for file in *.jpg ; do gimp $file ; done You will have to close gimp after every picture, but no need to hit enter on the commandline.
I just want to add a footnote that this should become easy after the upcoming UI changes. The plan favored by the UI team is that after the last open image is closed, a "scratch" image would be opened to keep the interface alive. It would be easy to make it happen that in "sequential" mode, instead of opening a scratch image, GIMP would open the next image in the list.
That would be very handy! I'd definitely use it if it were available. I usually ls the files that need editing (in a terminal window), then select 3-5 of them at a time and run gimp on those (or gimp-remote with earlier versions). But that requires keeping a terminal open and going back to it after each batch is done to load a new batch. I wouldn't want to loop over starting gimp every time; it takes quite a while to load script-fu and plug-ins.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/38.