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 740203 - Textured Logo scripts inappropriately defines a global
Textured Logo scripts inappropriately defines a global
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
2.8.14
Other All
: Normal minor
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2014-11-16 07:57 UTC by saulgoode
Modified: 2014-11-18 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to remove globally-defined 'scale' procedure (1.77 KB, patch)
2014-11-16 07:57 UTC, saulgoode
none Details | Review

Description saulgoode 2014-11-16 07:57:36 UTC
Created attachment 290782 [details] [review]
Patch to remove globally-defined 'scale' procedure

plug-ins/script-fu/scripts/textured-logo.scm defines a global procedure named 'scale' whose only function is to return the product of its two arguments. While there may be valid reasons for having such a function such as disallowing variadic arguments and providing a better indication of what is being performed, it is inappropriate to do this in the global namespace of Script-fu.

While this definition of 'scale' causes no problem with "factory" GIMP (the 'scale' procedure is not used anywhere outside of the two textured logo filters), it could lead to problems in third party scripts. Granted, the biggest problem of third-party scripts defining their own global 'scale' procedure is equally misguided, but that does not justify such practices appearing in "official" scripts that ship with GIMP.

Patch attempts to resolve the problem by removing the definition of 'scale' and substituting any invocations of it with simple multiplication.
Comment 1 Michael Natterer 2014-11-18 20:38:50 UTC
Thanks, pushed to gimp-2-8:

commit 57603055c32a34b52d351cf7fb08a60c7f6ee428
Author: Saul Goode <saul@crazyauntgail.com>
Date:   Sat Nov 15 18:28:42 2014 -0500

    Bug 740203 - Textured Logo scripts inappropriately defines a global
    
    Remove global proc def in textured-logo script.

 plug-ins/script-fu/scripts/textured-logo.scm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)