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 98490 - File plug-ins should not use hardcoded default comment
File plug-ins should not use hardcoded default comment
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: Plugins
1.x
Other All
: Normal minor
: 1.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2002-11-14 15:40 UTC by Raphaël Quinet
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file with proposed quick fix for bug #98490 (3.62 KB, patch)
2003-05-11 18:22 UTC, Dave Neary
none Details | Review
New try - if no comment is set, do nothing. (3.33 KB, patch)
2003-05-11 19:37 UTC, Dave Neary
none Details | Review

Description Raphaël Quinet 2002-11-14 15:40:25 UTC
Several file plug-ins use a hardcoded string for the default comment if no
comment is already attached to the image.  This should be avoided because
the user has no way to change that default value.

Here are the offenders, as of 1.2.4-pre1:
- csource.c:#define DEFAULT_COMMENT "Created with The GIMP"
- jpeg.c:#define DEFAULT_COMMENT     "Created with The GIMP"
- tiff.c:#define DEFAULT_COMMENT "Created with The GIMP"
- xbm.c:  strncpy (xsvals.comment, _("Created with The GIMP"), MAX_COMMENT);

The best long-term solution would be to copy the default comment from the
preferences instead of taking the hardcoded value (see bug #98485), but for
1.2.4 the best option is to leave the comment empty instead of using the
hardcoded strings.  The current gif.c plug-in leaves it empty instead of
using "Made with GIMP" as it did before.  All plug-ins should do that.
Comment 1 Dave Neary 2003-05-10 18:08:55 UTC
What's the story on this one? Is there a quick fix in the pipeline? If
not, I suggest bumping it.

Dave.
Comment 2 Sven Neumann 2003-05-11 00:21:21 UTC
It should be easy to fix these four plug-ins to not use any hard-coded
comment.
Comment 3 Dave Neary 2003-05-11 18:21:18 UTC
For xbm, this is a non-issue. The writing of a comment is currently
disabled in the gimp. See bug #82673.

For the others, I've attached a patch (as it happens, this patch also
also contains Maurits's 1.3 fix for bug #95737, which never got
backported to the 1.2 branch (it's one of those bugs that will give
translators headaches - in 1.3 it's a split string).

Cheers,
Dave.

Comment 4 Dave Neary 2003-05-11 18:22:45 UTC
Created attachment 16432 [details] [review]
Patch file with proposed quick fix for bug #98490
Comment 5 Sven Neumann 2003-05-11 18:47:57 UTC
Is empty string the right thing to do here? I don't think so. IMHO, no
comment should be set instead of an empty one.
Comment 6 Dave Neary 2003-05-11 19:37:38 UTC
Created attachment 16434 [details] [review]
New try - if no comment is set, do nothing.
Comment 7 Dave Neary 2003-05-11 19:40:46 UTC
In fact, the fixes work out equivalent, because the code afterwards tests
if(comment && *comment)
{
  attach parasite
}

Cheers,
Dave.
Comment 8 Sven Neumann 2003-05-12 13:31:07 UTC
Please commit to both branches.
Comment 9 Dave Neary 2003-05-12 14:44:12 UTC
Probably a silly question - will this also close bug #98485 ?

I don't think so, but I'm not sure how best to address the problem in
98485, aside from what's already be done (the attachment of the
default image everywhere the GIMP creates a new image).

Cheers,
Dave.
Comment 10 Dave Neary 2003-05-13 07:08:14 UTC
Fixed in 1.2:
2003-05-12  Dave Neary  <bolsh@gimp.org>

        * plug-ins/common/csource.c
        * plug-ins/common/jpeg.c
        * plug-ins/common/tiff.c: If no comment is set on a
        GimpImage when it arrives to be saved, don't attach one.
        Fixes bug #98490 and bug #98485

        * plug-ins/common/tiff.c: Alert user to loss of precision
        when opening a 16 bit tiff. Backport of Maurits Rijk's
        fix for bug #95737

Comment 11 Sven Neumann 2003-05-13 15:09:38 UTC
Bolsh, can you please make sure this change goes into HEAD as well?
Actually changes are supposed to happen in 1.3 first, then being
backported to the stable branch.
Comment 12 Dave Neary 2003-05-13 16:04:21 UTC
I will do, this evening. I was rushing to get this done this morning;

Dave.
Comment 13 Dave Neary 2003-05-13 19:49:41 UTC
Fixed in HEAD: 

2003-05-12  Dave Neary  <bolsh@gimp.org>

        * plug-ins/common/csource.c
        * plug-ins/common/jpeg.c
        * plug-ins/common/tiff.c: If no comment is set on a
        GimpImage when it arrives to be saved, don't attach one.
        Fixes bug #98490 - and removes code which does what is
        suggested in bug #98485 as correct behaviour.
Comment 14 Raphaël Quinet 2003-06-20 17:15:54 UTC
The fix is part of the stable release 1.2.4.  Closing this bug.