After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767603 - Add sample use of the with-files macro to the Basic Batch tutorial
Add sample use of the with-files macro to the Basic Batch tutorial
Status: RESOLVED OBSOLETE
Product: gimp-web
Classification: Infrastructure
Component: www.gimp.org
unspecified
Other All
: Normal normal
: ---
Assigned To: The GIMP web bugs mail alias
The GIMP web bugs mail alias
Depends on:
Blocks:
 
 
Reported: 2016-06-13 11:43 UTC by Michael Schumacher
Modified: 2018-09-21 16:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Schumacher 2016-06-13 11:43:48 UTC
With bug 726947, a new and easy way to apply script code to a list of files has been applied to the development branch of GIMP. 

This obsoletes most of the code in our Basic Batch tutorial examples, namely all the file-globing and looping through the results returned by the loop - the user can concentrate on writing the actual image-manipulation code and only has to worry about exporting and/or saving the modified image afterwards.
Comment 1 Jehan 2016-06-13 11:54:46 UTC
Info for documenters, here is the documentation comment for the macro, which already has some examples:

; Allow command line usage of GIMP such as:
;
;     gimp -i -b '(with-files "*.png" <body>)'
;
; where <body> is the code that handles whatever processing you want to
; perform on the files. There are four variables that are available
; within the <body>: 'basename', 'image', 'filename' and 'layer'.
; The 'basename' is the name of the file with its extension removed,
; while the other three variables are self-explanatory.
; You basically write your code as though it were processing a single
; 'image' and the 'with-files' macro applies it to all of the files
; matching the pattern.
;
; For example, to invert the colors of all of the PNG files in the
; start directory:
;
;    gimp -i -b '(with-files "*.png" (gimp-invert layer) \
;                 (gimp-file-save 1 image layer filename filename ))'
;
; To do the same thing, but saving them as jpeg instead:
;
;    gimp -i -b '(with-files "*.png" (gimp-invert layer) \
;                 (gimp-file-save 1 image layer \
;                  (string-append basename ".jpg") \
;                  (string-append basename ".jpg") ))'

Obviously the tutorial could go further and show even more goodies done with this macro! :-)
Comment 2 Pat David 2016-07-15 18:16:05 UTC
(In reply to Michael Schumacher from comment #0)
> With bug 726947, a new and easy way to apply script code to a list of files
> has been applied to the development branch of GIMP. 
> 
> This obsoletes most of the code in our Basic Batch tutorial examples, namely
> all the file-globing and looping through the results returned by the loop -
> the user can concentrate on writing the actual image-manipulation code and
> only has to worry about exporting and/or saving the modified image
> afterwards.

What is the action item on this then?  Do we need to revisit and re-write the Basic Batch tutorial?
Comment 3 GNOME Infrastructure Team 2018-09-21 16:02:47 UTC
-- 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/Infrastructure/gimp-web/issues/65.