Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I reset this number to 0 without to have to quit the software?
#1
[Image: GIMP.png]

I tried to search for it but couldn't find anything to it cause I think I don't use the good key word for it (non native english). Please is there a way to reset this number? If so, how can I do?
Reply
#2
You can't. It's a unique image identifier, so it looks like the 43nd image you opened in that Gimp session (count starts at 0).

However, if you want a different display in the titlebar, you can cheat...

The title bar contents are created from a "format string" where items identified with a %X notation are replaced by data from the image:

   


In this image 7.0 means it's the 8th image, 1st view (because you can create several views per image). But you can replace %p.%i by a fixed value (after all the "." between them is a fixed value, as ar some other punctuation characters) so for instance "0.0":

   

If you try you'll see that the image title bar is updated as you type, so if this is for a one-shot screenshot, you don't even need to set the preferences.
Reply
#3
There are more codes available than shown in Edit -> Preferences

Code:
%f: base filename
%F: full filename
%p: PDB id
%i: instance
%t: image type
%T: drawable type
%s: user source zoom factor
%d: user destination zoom factor
%z: user zoom factor (percentage)
%D: dirty flag
%C: clean flag
%B: dirty flag (long)
%A: clean flag (long)
%m: memory used by image
%M: image size in megapixels
%l: number of layers
%L: number of layers (long)
%n: active drawable name
%P: active drawable PDB id
%W: width in real-world units
%w: width in pixels
%H: height in real-world units
%h: height in pixels
%u: unit symbol
%U: unit abbreviation
%X: drawable width in real world units
%x: drawable width in pixels
%Y: drawable height in real world units
%y: drawable height in pixels
%o: image's color profile name
%e: view offsets in pixels
%r: view rotation angle in degrees

So not difficult to make your own bespoke title or status bars - but the defaults are usually best.

   
Reply
#4
Thanks both for the answers.

I asked cause I've a script "fu" that do things on image ID 1 to 100, so if want to repeat the script on another group of image I've to quit the app to reset that number so the script work. I guess I can increase the number ID on my script up to 1000 but it's not an elegant solution as I've then to pick the portion of the script for the current ID, like if I'm at 60 and I've up to 120 I pick the line that change them, so it's best to quit the software and launch it again.

Here is the script line :
(gimp-image-scale ID 128 128)
ID for the number of the image.
Repeated up to 100 times to quickly scale a group of images.
Reply
#5
(04-25-2023, 08:35 PM)Watler253 Wrote: Thanks both for the answers.

I asked cause I've a script "fu" that do things on image ID 1 to 100, so if want to repeat the script on another group of image I've to quit the app to reset that number so the script work. I guess I can increase the number ID on my script up to 1000 but it's not an elegant solution as I've then to pick the portion of the script for the current ID, like if I'm at 60 and I've up to 120 I pick the line that change them, so it's best to quit the software and launch it again.

Here is the script line :
(gimp-image-scale ID 128 128)
ID for the number of the image.
Repeated up to 100 times to quickly scale a group of images.

Your script can get the list of loaded images ((gimp-image-list), in script-fu, I think), no need to iterate image ids at random...

In the python console, to scale all loaded images:

Code:
for image in gimp.image_list(): image.scale(120,80)
(strike [enter] until you are back to the > > > prompt)


The script-fu equivalent isn't much more complicated (but I don't know script-fu).
Reply
#6
Oh well thanks a lot, the python script works like a charm, I feel a little stupid now but doesn't matter I have the power!
Reply


Forum Jump: