Skip to content

bug: warnings incorrectly treated as errors #30

Description

@BluDood

Hello,
I have taken this library in use and it seems to be working well, however I am trying to simply strip all properties from the EXIF data of an image with the args:

-all=

However this produces a warning printed to stderr:

Warning: ICC_Profile deleted. Image colors may be affected - <file_name>

This library currently treats anything logged to stderr as an errored state, and does not return the data as expected. Programs usually also print stuff such as progress and warnings to stderr. A better solution would probably be to treat exit code 0 as success, and exit code != 0 as error, and maybe also return stderr in the response.

This is the part that needs the change:

exiftool/src/index.ts

Lines 241 to 248 in 2578540

if (stderrContent && stderrContent.trim()) {
return {
success: false,
data: undefined,
error: stderrContent,
exitCode: 0,
};
}

I'm happy to work on submitting a PR for this!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions