Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Old-photo-bakumatu incompatible with 2.10.21
#1
Bug 
Hi,
Win10, Gimp 2.10.21 Sam's Portable, Script old-photo-bakumatu.scm.

I got this script from a link provided by @Nidhogg at http://gimpchat.com/viewtopic.php?f=9&t=...10#p237580, and I really like it, both the results it produces directly and the possibilities it allows to be added manually after its execution.

It has always worked in the previous 2.10 versions I have used of Gimp, but in this current version (2.10.21 Sam's Portable) unfortunately it does not seem to be compatible and has errors and does not run completely.

The error messages are always as shown below, with the exception of the value called for the Plasma plugin (plug-in-plasma), these values always change, even for the same image.
   

I wish someone could fix this script, make it functional again.

Thanks in advance!
Reply
#2
(07-07-2020, 06:45 PM)Krikor Wrote: Hi,
Win10, Gimp 2.10.21 Sam's Portable, Script old-photo-bakumatu.scm.

I got this script from a link provided by @Nidhogg at http://gimpchat.com/viewtopic.php?f=9&t=...10#p237580, and I really like it, both the results it produces directly and the possibilities it allows to be added manually after its execution.

It has always worked in the previous 2.10 versions I have used of Gimp, but in this current version (2.10.21 Sam's Portable) unfortunately it does not seem to be compatible and has errors and does not run completely.

The error messages are always as shown below, with the exception of the value called for the Plasma plugin (plug-in-plasma), these values always change, even for the same image.


I wish someone could fix this script, make it functional again.

Thanks in advance!

Quite strange...
  1. The code goes: (plug-in-plasma 1 img channel (srand (realtime)) 5.0).
  2. (realtime) returns the current time in seconds since Jan 1, 1970 00:00 UTC, and is a quick way to get a different value each time the code is executed.
  3. (srand (realtime)) "seeds" the pseudo-random number generator with that value. But as far as I can tell the value returned by (srand) is not random, it is the input value...). The real purpose of (srand) is to make the random sequence repeatable (identical seeds yield identical sequences). This is convenient for tests and debug, but you lose the randomness. In this script it is pointless, and in this very script, the two back-to-back calls to (plugin-solid-noise) are in most cases using the same value unless you are on a very, very slow PC.
  4. However since (srand) returns its passed seed value, if it returns a negative number your PC date is set to before Jan 1, 1970, so you are a time traveller....
You can try to fix the script by replacing (srand (realtime)) everywhere by just (random).

PS: out of curiosity, if you start your script-fu console, what are the results of:
  • (srand 125)
  • (realtime)
  • (srand (realtime))
Reply
#3
(07-07-2020, 10:02 PM)Ofnuts Wrote:
(07-07-2020, 06:45 PM)Krikor Wrote: Hi,
Win10, Gimp 2.10.21 Sam's Portable, Script old-photo-bakumatu.scm.

I got this script from a link provided by @Nidhogg at http://gimpchat.com/viewtopic.php?f=9&t=...10#p237580, and I really like it, both the results it produces directly and the possibilities it allows to be added manually after its execution.

It has always worked in the previous 2.10 versions I have used of Gimp, but in this current version (2.10.21 Sam's Portable) unfortunately it does not seem to be compatible and has errors and does not run completely.

The error messages are always as shown below, with the exception of the value called for the Plasma plugin (plug-in-plasma), these values always change, even for the same image.


I wish someone could fix this script, make it functional again.

Thanks in advance!

Quite strange...
  1. The code goes: (plug-in-plasma 1 img channel (srand (realtime)) 5.0).
  2. (realtime) returns the current time in seconds since Jan 1, 1970 00:00 UTC, and is a quick way to get a different value each time the code is executed.
  3. (srand (realtime)) "seeds" the pseudo-random number generator with that value. But as far as I can tell the value returned by (srand) is not random, it is the input value...). The real purpose of (srand) is to make the random sequence repeatable (identical seeds yield identical sequences). This is convenient for tests and debug, but you lose the randomness. In this script it is pointless, and in this very script, the two back-to-back calls to (plugin-solid-noise) are in most cases using the same value unless you are on a very, very slow PC.
  4. However since (srand) returns its passed seed value, if it returns a negative number your PC date is set to before Jan 1, 1970, so you are a time traveller....
You can try to fix the script by replacing (srand (realtime)) everywhere by just (random).

PS: out of curiosity, if you start your script-fu console, what are the results of:
  • (srand 125)
  • (realtime)
  • (srand (realtime))

Hi Ofnuts,

Well ... my pc is not that Jurassic, in fact this same script ran well in previous versions of gimp, at least between 2.10.06 and 2.10.18.
The date of my PC's system is ok, possibly that was a rhetorical question.
In my time travels, I never take my pc with me :-)

"You can try to fix the script by replacing (srand (realtime)) everywhere by just (random) "

I will do that, open an editor, and make this replacement.

"PS: out of curiosity, if you start your script-fu console, what are the results of:

(srand 125)
(realtime)
(srand (realtime)) "

Sorry, but how do I boot (start) from the console? I do not know how to do this.  Confused Blush

I changed the three occurrences of: (srand (realtime)) by just (random).

Changed the error, but still doesn't execute the script in an expected way.
   

===========================================================================================
I researched how to open the console ....
and voilà :
   
Reply
#4
hummm ... I think I did it right now.
   
Reply
#5
It's weird...  Confused
I can only say that I don't understand, but after following the guidelines given above by Ofnuts, somehow the script returned to work.  Shy

I basically:
►I doubled the .scm file.
►The original I removed from the script folder and left in another folder as a backup.

►In the duplicated copy I made the edit changing the 3 occurrences in which it appeared (srand (realtime)) to (random).
►I tested the script with the change made. As I reported earlier with an attached image, the change did not have the desired effect.

►I executed the commands on the console as shown in the previous images. (srand 125) (realtime) (srand (realtime))

►So, in order to continue using the script with version 2.10.12 where it worked without a problem, I returned the original file from the folder where it had been reserved to the scripts folder (before I removed the edited copy from that folder).
►And to my surprise, the script just started to work correctly, without errors, and generating all the layers (5) in a new image, and not just 2 layers as it did during its malfunction.

Ofnuts, thank you very much!  Big Grin
Reply
#6
I can get that error message. The plugin from GC seems to work here in a Win10 / samj gimp 2.10.21 some of the time. 
I think connected to the plasma 'plugin' which changed to a GEGL operation in Gimp 2.10 

Plasma plugin parameters.
Gimp 2.8
seed INT32 Random seed
turbulence FLOAT Turbulence of plasma

Gimp 2.10
seed INT32 Random seed (seed >= -1) 
turbulence FLOAT The value of the turbulence (0 <= turbulence <= 7)


It looks like  (srand (realtime) is generating that negative seed. The (random) function did change between Gimp 2.8 and Gimp 2.10

My fix, just set a (random seed) manually.  (random 12345) gives a value between 0 and 12345 (about as random as the Sinclair ZX81 Wink   ) so the effect does change a little. 

Tried and working (a couple of times) Win10 / samj 2.10.21

FWIW script attached.


Attached Files
.zip   old-photo-bakumatu-210.scm.zip (Size: 1.88 KB / Downloads: 13)
Reply
#7
Salut Rich2005,

It seems that the random question of the generated seed would allow the script to work or not, depending on whether the result met the new limitations in Gimp 2.10:

seed INT32 Random seed (seed> = -1)
turbulence FLOAT The value of the turbulence (0 <= turbulence <= 7)

I tested the script with the change (random 12345) and it is working ok.

Thank you very much Rich2005!  Big Grin
Reply


Forum Jump: