Investigate the ability to catch stderr from libexiv2 in pyexiv
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyexiv2 |
Fix Released
|
Wishlist
|
Olivier Tilloy |
Bug Description
Email conversation below. Basically it would be a nice feature to be able to catch errors in a python exception to report on which file has a the error. When traversing large amounts of files the errors sent to stdout do not state which file has the error.
Simon Morley a écrit :
> > Hi Oliver,
> >
> > I've just started using pyexiv2 and from what I've seen it looks very
> > good. However can you tell me how to suppress warnings?
> > Also is it possible to catch errors higher up and deal with them? The
> > errors don't seem to report what file has the error which is annoying.
The warnings and errors are issued on the standard error stream by
libexiv2 itself, upon which pyexiv2 is built.
A quick solution to drop them is to simply redirect stderr to /dev/null.
I'm not sure there is much that can be done to in pyexiv2 to
ignore/catch those messages unless an exception is thrown by libexiv2
(in which case it's easy to translate it into a python exception), but
it's worth investigating.
Changed in pyexiv2: | |
status: | Triaged → Confirmed |
Changed in pyexiv2: | |
assignee: | nobody → Olivier Tilloy (osomon) |
status: | Confirmed → In Progress |
Changed in pyexiv2: | |
milestone: | none → 0.3 |
Changed in pyexiv2: | |
status: | Fix Committed → Fix Released |
Note: the errors mentioned by Simon are the "Error" and "Warning" messages output on stderr while reading an image file if libexiv2 fails to parse some metadata, e.g.:
Error: Directory Image: Next pointer is out of bounds; ignored.
Warning: Directory Image, entry 0x0000 has unknown Exif (TIFF) type 0; setting type size 1.
Error: Directory Unknown with 54333 entries considered invalid; not read.
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Error: Directory Unknown with 8f64 entries considered invalid; not read.
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Error: Directory Unknown with 53c1 entries considered invalid; not read.
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Error: Directory Unknown with 42dd entries considered invalid; not read.
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Error: Directory Unknown with 7c8 entries considered invalid; not read.
Warning: Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
Error: Directory Canon with 1800 entries considered invalid; not read.