fixup! De-zigzag JPEG's DQT when loading; deprecate convert_dict_qtables

This commit is contained in:
gofr 2020-10-17 20:45:54 +02:00
parent 9980981c2e
commit 4dc195333e

View File

@ -588,7 +588,8 @@ def convert_dict_qtables(qtables):
warnings.warn( warnings.warn(
"convert_dict_qtables is deprecated and will be removed in a future" "convert_dict_qtables is deprecated and will be removed in a future"
" release. Conversion is no longer needed.", " release. Conversion is no longer needed.",
DeprecationWarning) DeprecationWarning,
)
return qtables return qtables
@ -670,7 +671,8 @@ def _save(im, fp, filename):
if isinstance(qtables, (tuple, list, dict)): if isinstance(qtables, (tuple, list, dict)):
if isinstance(qtables, dict): if isinstance(qtables, dict):
qtables = [ qtables = [
qtables[key] for key in range(len(qtables)) if key in qtables] qtables[key] for key in range(len(qtables)) if key in qtables
]
elif isinstance(qtables, tuple): elif isinstance(qtables, tuple):
qtables = list(qtables) qtables = list(qtables)
if not (0 < len(qtables) < 5): if not (0 < len(qtables) < 5):