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 131975 - Tiff multipage w/multiple warning msg.
Tiff multipage w/multiple warning msg.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
1.x
Other All
: Normal minor
: ---
Assigned To: Raphaël Quinet
Raphaël Quinet
Depends on:
Blocks:
 
 
Reported: 2004-01-20 02:48 UTC by eric_wmaker
Modified: 2004-01-31 22:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description eric_wmaker 2004-01-20 02:48:53 UTC
When I open a tiff w/multiple pages, it opens fine.  However, I get the
following warning messages:
First, I get the following errors.
tif: Unknown field with tag 33949 (0x849d) encountered

And these two errors repeat for the number of pages in the tif.
tif: Unknown field with tag 33950 (0x849e) encountered
tif: Unknown field with tag 33951 (0x849f) encountered

Here is a sample tiff image w/3 pages that demonstrates the warning
messages I'm getting.
http://epierce.freeshell.org/bugzilla/multipage.tif

Let me know if I can provide any other info.
Eric Pierce
Comment 1 Maurits Rijk 2004-01-20 09:23:54 UTC
From the TIFF Revision 6.0 spec: "An organization might wish to store
information meaningful to only that organi- zation in a TIFF file.
Tags numbered 32768 or higher, sometimes called private tags, are
reserved for that purpose."

The message comes from the libtiff library, so there's not much we can
do here.
Comment 2 Sven Neumann 2004-01-20 10:13:36 UTC
We could try to improve the error message. When libtiff gives this
warning, do we have a chance to find out if it's about a private tag?
Comment 3 Raphaël Quinet 2004-01-20 10:31:08 UTC
Well, libtiff defines TIFFSetWarningHandler() and TIFFSetErrorHandler()
that are used by the GIMP tiff plug-in to intercept the libtiff warnings
and errors and handle them using the private functions tiff_warning()
and tiff_error().  Currently, both of these functions are simply passing
the messages to g_logv().

We could do some simple pattern matching and intercept all messages
containing "Unknown field with tag".  Since these functions in the
plug-in get all parameters (varags-style), we could even check if the
tag number is greater than 32768.  If you think that it would be an
appropriate solution, then I could work on it and propose a patch
tomorrow.
Comment 4 Sven Neumann 2004-01-20 10:39:37 UTC
Perhaps it would be sufficient to differentiate the importance of the
messages generated from libtiff. Messages coming from the libtiff
warning handler could have a note about being harmless or purely
informative.

At some point we need to improve how messages from plug-ins are
handled. I'd suggest we implement a scheme similar to the g_log
mechanism in glib. Plug-ins can then tell GIMP about the severity
level of their messages. GIMP can then display different dialogs for
messages, warnings and errors and the user could choose to suppress
messages below a certain level.
Comment 5 Raphaël Quinet 2004-01-20 13:14:13 UTC
Yes, but note that the libtiff API does not include a severity level.
This means that the tiff plug-in would have to do some pattern matching
on the messages, then assign severity levels before passing them to
the GIMP.  This should not be too hard to do.

So, should we set the milestone to Future and wait until we have a new
API for passing messages, or should we try to fix only the problem
reported here by just skipping the messages about unknown tags?
Comment 6 Dave Neary 2004-01-20 13:26:05 UTC
You said there are two levels of severity supported by libtiff
(warning and error, via TIFFSetWarningHandler and TIFFSetErrorHandler)
- this is good enough for our purposes. 

Cheers,
Dave.
Comment 7 Raphaël Quinet 2004-01-20 16:23:45 UTC
Well, this could be good if we wanted to limit ourselves to 2 levels,
but I think that Sven's comment implied that we would have more than
2 levels (i.e., at least have a 3rd level that would be for
informational messages).

The problem with libtiff's warning messages is that some of them are
more serious than others.  For example, looking only in tif_dirread.c,
there is the warning "unknown field with tag %d (0x%x) ignored", which
should be ignored or considered as a simple informational message if
a private tag (< 32768) is found, but should probably be reported as a
real warning if this occurs with a standard tag.  Also, the same file
contains warnings such as: "TIFF directory is missing required \"%s\"
field, calculating from imagelength" (where %s would be
StripByteCounts).  Still in that file: "wrong data type %d for \"%s\";
tag ignored".  Some other files in libtiffs have warnings that
indicate that some scanlines could be discarded.  These sound like
real warnings to me, because they could lead to data corruption if
there is really something wrong in the file.  That's why I think that
we need more severity levels than "warning" and "error".  We also
need something less severe that can be ignored by the user.
Comment 8 Sven Neumann 2004-01-20 16:33:08 UTC
Absolutely right. But for the moment we don't have this infrastructure.
I was hoping we could get away with dropping tiff warnings and
displaying tiff errors only.
Comment 9 Raphaël Quinet 2004-01-30 14:04:59 UTC
I will work on bug #131975 and bug #132297.  As a workaround for 2.0,
I will modify the tiff_warning() function in the plug-in so that it
ignores a few messages from libtiff (unknown tag for tags > 32768, and
random access not supported).  A better solution for a future release
(2.2 or later) should allow the user to select which messages should
be ignored, but this will require an improved infrastructure for
passing messages from plug-ins and allowing multiple severity levels.
Comment 10 Andrey Kiselev 2004-01-30 21:36:01 UTC
I think it is better to replace the annoying message boxes with the
single scrollable window which will accumulate all the errors and
warnings. Some TIFFs may be awfully broken and libtiff will complain
on every scanline. It is not a usual case for the most users, though,
but very frequent case for me.

I can fill the separate entry with this feature request for one of the
future GIMP versions, if you agree with my suggestion.
Comment 11 Raphaël Quinet 2004-01-31 22:54:01 UTC
I have fixed the problem described here by skipping the warning
message from libtiff if the tag is >= 32768.  I have also submitted
a new enhancement proposal for allowing the user to customize which
message should be shown or hidden.  See bug #133093.

If you would think that it would be interesting to have all messages
in the same dialog with a scrollbar, please submit a new enhancement
proposal.

2004-01-31  Raphaël Quinet  <quinet@gamers.org>

  * plug-ins/common/tiff.c (tiff_warning, tiff_error): Do not
  display the warning message about unknown tags for unregistered
  private tags (>= 32768).  Fixes bug #131975.  Do not display the
  error message about random access not supported for images using
  JPEG compression.  Fixes bug #132297.  It would be better to allow
  the user to customize which messages should be displayed or not,
  but this can be done in a future release.