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 129529 - Allow random seed to be specified in PDB call
Allow random seed to be specified in PDB call
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: libgimp
git master
Other All
: Normal normal
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-12-17 11:01 UTC by Dave Neary
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
random seed with randomize toggle off (46.92 KB, image/png)
2003-12-20 15:32 UTC, Dave Neary
Details
Same thing with "Randomize" toggled. Notice that the seed value is changed, and the adjustment and "New seed" buttons are insensitive. (46.41 KB, image/png)
2003-12-20 15:34 UTC, Dave Neary
Details

Description Dave Neary 2003-12-17 11:01:01 UTC
Several plug-ins changed their API in the PDB to remove the parameter
"use_time" or similar. This parameter should be added back, since it was
very useful for scripts. The plug-ins which use gimp_random_seed_new (),
and which are therefore likely to be affected, are:

plug-ins/common/blur.c
plug-ins/common/plasma.c
plug-ins/common/randomize.c
plug-ins/common/sinus.c
plug-ins/common/snoise.c
plug-ins/gflare/gflare.c
plug-ins/maze/maze_face.c

Of these only the pdb calls installed by randomize and blur had criteria in
1.2 for setting a random seed, so these are probably the only ones that
require a PDB change.

Dave.
Comment 1 Dave Neary 2003-12-17 14:52:28 UTC
Fixed in CVS:

2003-12-17  Dave Neary  <bolsh@gimp.org>
 
        * libgimpwidgets/gimpwidgets.[ch]: Change signature of
        gimp_random_seed_new() to allow caller to specify that he wants to
        use a random seed rather than the specified seed. Previously
it was
        up to the caller to initialise the seed.
 
        * plug-ins/gflare/gflare.c
        * plug-ins/maze/maze_face.c
        * plug-ins/common/plasma.c
        * plug-ins/common/sinus.c
        * plug-ins/common/snoise.c: Trivial modifications of call to
        gimp_random_seed_new() with FALSE.
 
        * plug-ins/common/blur.c
        * plug-ins/common/randomize.c: Modify PDB routines and tool
options
        to allow a random seed to be specified. Useful for scripts.
Reverts
        PDB to 1.2 state. Fixes bug #129529.
 
Comment 2 Dave Neary 2003-12-20 15:30:42 UTC
Following some discussion on this, I've reopened it. I'll attach a
couple of screenshots of the modified, almost finished, interface as
it is now. 

Comments welcome.

Dave.
Comment 3 Dave Neary 2003-12-20 15:32:56 UTC
Created attachment 22596 [details]
random seed with randomize toggle off
Comment 4 Dave Neary 2003-12-20 15:34:29 UTC
Created attachment 22597 [details]
Same thing with "Randomize" toggled. Notice that the seed value is changed, and the adjustment and "New seed" buttons are insensitive.
Comment 5 Dave Neary 2003-12-20 15:36:30 UTC
For the record, I don't think we should do this. But it could be done
pretty quickly if others decided it were desirable.

Cheers,
Dave.
Comment 6 Dave Neary 2003-12-26 21:26:55 UTC
Given that there's been no comment on this, I'm re-closing this bug as
fixed. If there's a problem with this it can be dealt with in a month
or so when we fork a maintenance branch.

Cheers,
Dave.
Comment 7 Michael Natterer 2004-01-19 14:31:47 UTC
Sorry, I missed the closing of this bug because I was mostly
offline during the christmas holidays.

I still think the random seed should look like in the
screenshots above.
Comment 8 Henrik Brix Andersen 2004-01-19 14:41:23 UTC
Sorry - I missed the closing of this bug as well. I agree with mitch.
Comment 9 Dave Neary 2004-01-19 14:50:11 UTC
Hi,

Setting milestone to 2.2 as duscussed in the comment above. Hopefully
I can find this patch again. For the record, I'm still against this
change.

Cheers,
Dave.
Comment 10 Michael Natterer 2004-01-19 15:26:58 UTC
Resetting milestone to 2.0. We can't change the API nor
the behaviour of the random seed during the 2.x cycle.

Bolsh, we sould not restrict what the user is able to
do with random values. We just need to make sure
we have sane defaults that don't need to be changed
to get "run with last values" working.
Comment 11 Dave Neary 2004-01-19 15:59:03 UTC
Can I just clear up what the expected behaviour should be, then?

1) Default situation: A random seed is set in the random seed entry,
and "Use random seed" is unchecked. When the plug-in is applied, "run
with last vals" produces exactly the same result as the first time it
was run, by using the same random seed.

2) Rather than specify a random seed, the user clicks "use random
seed", and then "run with last values" produces a different random result.

Is that all there is?

In which case, am I the only one who finds this interface confusing?

Cheers,
Dave.
Comment 12 Michael Natterer 2004-01-19 16:07:45 UTC
Yes, that's exactly what I meant.

It may be not the easiest possible UI but IMHO we sould
not trade features for easiness of use.

And btw, I don't really see why the screenshots above
are confusing.
Comment 13 Dave Neary 2004-01-19 16:19:07 UTC
OK - I'll do the change. I just want to point out that the PDB changes
that this would have needed have already been done, so there was no
reason to insist on this being in 2.0. That said, I'll get a minute
somewhere to do up the patch I had so that it works properly.

Dave.
Comment 14 Dave Neary 2004-01-31 23:34:34 UTC
2004-02-01  Dave Neary  <bolsh@gimp.org>
 
        * libgimpwidgets/gimpwidgets.c
        * libgimpwidgets/gimpwidgets.h: Modify random seed widget to
        allow the user to specify that a seed should be chosen
        randomly for them (useful to allow re-running random plug-ins
        several times to get several different results).
 
        * plug-ins/common/blur.c
        * plug-ins/common/plasma.c
        * plug-ins/common/randomize.c
        * plug-ins/common/sinus.c
        * plug-ins/common/snoise.c
        * plug-ins/gflare/gflare.c
        * plug-ins/maze/algorithms.c
        * plug-ins/maze/maze.c
        * plug-ins/maze/maze.h
        * plug-ins/maze/maze_face.c: Changed appropriately.
 
        This fixes bug #129529.