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 360423 - sequence interface on color incomplete
sequence interface on color incomplete
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Gimp-Python
git master
Other All
: Normal enhancement
: ---
Assigned To: Manish Singh
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-10-07 16:01 UTC by Hans Breuer
Modified: 2006-10-11 06:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
slice interface for gimpcolor.RGB (1002 bytes, patch)
2006-10-07 16:02 UTC, Hans Breuer
none Details | Review

Description Hans Breuer 2006-10-07 16:01:11 UTC
some of my (old) pygimp scripts are using a simple way to write colors to HTML, see traceback below, where bcolor is a gimpcolor.RGB passed into the script by PF_COLOR (255,255,255). I could not find a completely compatible way to recover the sequence facility, so I tried:

	# we are only interested in rgb, not a
	bcolor = bcolor[:2]

But to make that work tp_slice needs to be supported, as in the patch following.

Traceback (most recent call last):
  • File "d:\devel\python23\lib\gimpfu.py", line 616 in response
    dialog.res = run_script(params)
  • File "d:\devel\python23\lib\gimpfu.py", line 303 in run_script
    return apply(function, params)
  • File "D:\graph\gimp-2.3.12\plug-ins\plug-ins\thumbnail.py", line 172 in python_thumbnail
    write_head(f, "Thumnails of " + sPath + sFilePattern, bcolor,bJs)
  • File "D:\graph\gimp-2.3.12\plug-ins\plug-ins\thumbnail.py", line 82 in write_head
    f.write ("</head>\n<body bgcolor=" + "#%2x%2x%2x" % (bcolor) + ">\n")
TypeError: int argument required

Comment 1 Hans Breuer 2006-10-07 16:02:30 UTC
Created attachment 74217 [details] [review]
slice interface for gimpcolor.RGB
Comment 2 Sven Neumann 2006-10-09 13:11:54 UTC
Looks like an enhancement request to me. And your patch has debug output that should be removed before it is accepted.
Comment 3 Manish Singh 2006-10-11 06:02:00 UTC
I implemented both slice and subscript, so extended slice notation can be used.

2006-10-10  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/pygimp-colors.c: Add slice support to the colors
        types. Fixes bug #360423.