hubmapconsortium / ingest-validation-tests

0 stars 0 forks source link

tiff_validator modified to mark files bad if tifffile emits a warning #43

Closed jswelling closed 1 year ago

jswelling commented 1 year ago

This PR addresses a problem with the previous version where only frank errors from the tifffile module caused a file to be marked invalid, but warnings like bad block offsets were ignored. The new version causes files that cause warnings to be marked invalid. It does so by the ugly hack of monkey-patching the routine tifffile uses to log warnings so that it raises an exception instead. That exception is caught by the validator and the file is marked invalid.