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

Implement TgaHeaderReader.TryExtract to not use exceptions as information #297

Open
drewnoakes opened this issue Jun 7, 2021 · 0 comments

Comments

@drewnoakes
Copy link
Owner

The current implementation of TgaHeaderReader.TryExtract returns false from a catch block. It should, instead, use return values to indicate when extraction failed.

This is more relevant than it may seem at first, as the FileTypeDetector infrastructure uses this code path to detect whether a file is TGA or not (there is no easy way to detect TGA, so we just attempt an extraction). For bulk file processing, this exception can occur regularly. This makes debugging annoying, and can hurt performance.

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

No branches or pull requests

1 participant