Add to-do

This commit is contained in:
Matthias Bisping 2023-02-07 10:18:53 +01:00
parent 3cea4dad2d
commit 092069221a

View File

@ -193,7 +193,7 @@ def has_alpha_channel(doc: Doc, xref: int):
maybe_image = load_image_handle_from_xref(doc, xref)
maybe_smask = maybe_image["smask"] if maybe_image else None
if maybe_smask: # Use monad
if maybe_smask: # TODO: Use monad.
return any([doc.extract_image(maybe_smask) is not None, bool(fitz.Pixmap(doc, maybe_smask).alpha)])
else:
try:
@ -261,7 +261,7 @@ def normalize_channels(array: np.ndarray):
@lru_cache(maxsize=None)
def load_image_handle_from_xref(doc: Doc, xref: int) -> Union[dict, None]: # TODO: use Monad
def load_image_handle_from_xref(doc: Doc, xref: int) -> Union[dict, None]: # TODO: Use monad.
return doc.extract_image(xref)