Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The '--quiet' option does not silence errors #64

Closed
00vareladavid opened this issue Sep 4, 2017 · 4 comments
Closed

The '--quiet' option does not silence errors #64

00vareladavid opened this issue Sep 4, 2017 · 4 comments

Comments

@00vareladavid
Copy link

For example: when I run exiv2 --quiet cabin.jpg, I get
File name : cabin.jpg File size : 142852 Bytes MIME type : image/jpeg Image size : 705 x 837 cabin.jpg: No Exif data found in the file

The last line is printing on stderr, so I expected --quiet to silence it. I am running GalliumOS(which is based on Ubuntu 16.04) on 64-bit x86 hardware, exiv2 version 0.26.

@clanmills
Copy link
Collaborator

clanmills commented Sep 4, 2017

The message is coming from the exiv2(.exe) application and not the library.

574 rmills@rmillsmbp:~/gnu/exiv2/0.26 $ grep 'No Exif data found in the file' src/actions.cpp 
                      << _("No Exif data found in the file\n");
            if (noExif) std::cerr << path_ << ": " << _("No Exif data found in the file\n");
                      << ": " << _("No Exif data found in the file\n");
                      << ": " << _("No Exif data found in the file\n");
                      << ": " << _("No Exif data found in the file\n");
                      << ": " << _("No Exif data found in the file\n");
                      << ": " << _("No Exif data found in the file\n");
575 rmills@rmillsmbp:~/gnu/exiv2/0.26 $

Perhaps the application should also respect the log level of the library. If the library has been silenced, perhaps applications should also keep silent.

How much pain is this causing? Can you just use exiv2 --quiet cabin.jpg 2>/dev/null

If you want me to investigate further, can you attach cabin.jpg so that I reproduce your use case.

@00vareladavid
Copy link
Author

I just assumed the expected behavior would be a clear stderr under the --quiet option. I'm not sure of the utility of the current behavior when using the CLI. Overall, I just wanted to bring it to your attention since the workaround (redirecting to /dev/null) is straightforward. (Slightly tangential question: if the library is being silenced, does this mean something else is writing the error messages?)

@clanmills
Copy link
Collaborator

Yes. The message is being written by the Exiv2 cli application. The library has been silenced.

@clanmills
Copy link
Collaborator

I'll reopen this issue if you wish to discuss this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants