drewnoakes/metadata-extractor-dotnet

Implement TgaHeaderReader.TryExtract to not use exceptions as information

オープン

#297 opened on 2021/06/07

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)C# (187 件のフォーク)github user discovery
help wanted

Repository metrics

Stars
 (1,059 個のスター)
PR merge metrics
 (平均マージ 11h 24m) (30d で 1 merged PR)

説明

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.

コントリビューターガイド