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 142587 - Solid Noise has no preview
Solid Noise has no preview
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.0.x
Other All
: Normal enhancement
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-05-15 17:54 UTC by Yeti
Modified: 2004-06-05 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A suggested patch. (11.49 KB, patch)
2004-05-15 18:05 UTC, Yeti
none Details | Review

Description Yeti 2004-05-15 17:54:42 UTC
Run the plug-in and look for a preview.

[A patch is going to be attached.]
Comment 1 Yeti 2004-05-15 18:05:33 UTC
Created attachment 27738 [details] [review]
A suggested patch.

This time I even expect the patch to be frowned at -- it uses a plain GdkPixbuf
in a GtkImage as a preview as I don't what the Right method of doing previews
is now (I'm willing to rewrite it, but not to anything with `Old' in name...)
Comment 2 Maurits Rijk 2004-05-17 12:55:43 UTC
We can always revert the `Old' back to `FixMe' ;) But more seriously: GdkPixbuf
and GtkImage are probaby the right objects to use. The general plug-in preview
widget is probably not going to happen for 2.2, so adding previews to existing
plug-ins is from a users standpoint of view a good thing.

Haven't looked at your patch yet, but does the preview also work correctly for
images with an alpha channel? Second question: is there any chance of putting
your work in a real widget? There have been a few efforts to do so in the past,
but I think they tried to solve to many things (like zooming) at once. Would be
nice to have a simple preview that might only work for 50 % of the plug-ins, but
at least it would be usable and easy to replace with something more advanced later.
Comment 3 Yeti 2004-05-17 14:04:30 UTC
Solid Noise always renders a new fully opaque drawable so I can't see how an
alpha channel could sneak in. This also means the preview implementation is
_very_ minimal, there's probably nothing to reuse elsewhere there. Regarding a
new Gimp preview widget, it's IMHO more a political problem now than a coding
one, and thus I'd be doomed to fail (a rough functional equivalent of
GimpOldPreview based on GdkPixbuf[s] is so easy to do that it would be
definitely done long ago if it was really the problem), sorry.
Comment 4 Maurits Rijk 2004-05-17 14:52:03 UTC
Oops, sorry. You're right, solid noise only renders. I was confusing it with the
spread plug-in. So displaying alpha is not an issue.

I don't think that there's a political problem, unless I'm missing something.
Only problem I've seen in the past is that people (including myself) tried to
create a preview widget that worked for all plug-ins. My advise would be to
start with a simple (no zooming, scrolling, etc.) preview widget that works for
a few plug-ins and then continue from there. In other words: taking very small
steps.
Comment 5 Yeti 2004-05-17 15:31:20 UTC
Well, if I find time to add previews to a few more plug-ins (a thing floating in
a indiferent position in my TODO), I can try to extract what I want from a
preview to a widget then.  But don't hold your breath, there's really `if' not
`when'...
Comment 6 Sven Neumann 2004-05-17 19:03:30 UTC
I don't think that GdkPixbuf and GtkImage are suited for a preview widget. If we
want to avoid GtkPreview, then the widget to use is either GtkDrawingArea or
preferably a custom widget that does all the drawing. Let me know if you need
help with this. For example it would be simple to give you a basic widget that
renders a buffer to the screen, optionally over a checkerboard pattern.
Comment 7 Yeti 2004-05-21 16:33:00 UTC
OK, back to reality.  Is the attached patch acceptable for 2.2?  It doesn't try
to implement new preview widget, it simply uses GtkImage as the preview widget
because it's functionality is sufficient [here].
Comment 8 Sven Neumann 2004-05-21 17:07:29 UTC
I don't see any advantage in using a GdkPixbuf and it strikes me wrong to
introduce yet another way of drawing previews. That will make it more difficult
to port to a preview widget when one is introduced. In general the patch is
probably OK (except that it doesn't conform with the new dialog layout but
that's easy to change).
Comment 9 Yeti 2004-05-21 18:52:34 UTC
The advantage of the approach is that it doesn't depend on what the current Gimp
preview widget is and how is it called today... I just copied it from my other
plug-ins where I've been using this tactics with success since GtkPreview was
deprecated... and as I said I'm willing to rewrite once there is something
definitive to rewrite it to.

The dialog layout is a shame, but I don't have clear idea how a HIGification
should actually look (don't have resources to follow gimp CVS).

Well, the question was yes or no, the answer was but, and the discussion already
took more labour than the code, which is itself trivial.   I'm putting this to
sleep, I'm happy I have Solid Noise with a preview, and I'm sorry for wasting
your time.  Maybe in some better time...
Comment 10 Sven Neumann 2004-05-21 19:33:12 UTC
Oh, come on. There are several patches that add plug-in previews waiting for
inclusion into CVS. They will all make it into CVS before the 2.2 feature
freeze. But before they are applied it would make sense to settle on a single
preview widget. I have already suggested how a simple widget and expressed my
interest to hack it myself if noone else wants to do it. You really have no
reason to be pissed.
Comment 11 Sven Neumann 2004-05-21 19:36:39 UTC
That should read "I have already suggested how a simple widget could look like",
meaning what functionality and API it should have.
Comment 12 Yeti 2004-05-21 19:41:45 UTC
I'm really not pissed. It just seems I'm currently not the right man for the job
of adding previews to plug-ins as I don't follow Gimp developmen very closely.
You could probably add the preview twice in the same time that takes/would take
correcting mine and discussing with me.
Comment 13 Sven Neumann 2004-05-21 20:04:55 UTC
I have now brought up the issue on gimp-developer. Give us a few days to come to
a conclusion here.
Comment 14 Sven Neumann 2004-06-05 10:54:21 UTC
I had to do quite some cleanups but didn't change the way the preview is drawn.
Applied to CVS HEAD:

2004-06-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/snoise.c: applied a modifed patch from Yeti that
	adds a preview to the Solid Noise plug-in (bug #142587).