Ensure _DISCARDED is not being cached. Fix #2825 (#2926)

Filtration is now being applied before caching the metadata, solving the issue where _DISCARD objects from previous runs were being retrieved from cache.
This commit is contained in:
Jonas Borges 2021-10-06 09:19:17 +01:00 committed by GitHub
commit 8849721913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 1 deletions

View file

@ -571,8 +571,9 @@ class Readers(FileStampDataCacher):
content, reader_metadata = self.get_cached_data(path, (None, None))
if content is None:
content, reader_metadata = reader.read(path)
reader_metadata = _filter_discardable_metadata(reader_metadata)
self.cache_data(path, (content, reader_metadata))
metadata.update(_filter_discardable_metadata(reader_metadata))
metadata.update(reader_metadata)
if content:
# find images with empty alt