Modify ImageMagick wrapper to handle animated images

This commit is contained in:
Kovid Goyal
2021-02-01 14:12:26 +05:30
parent edf4e14e4c
commit 9cf5348c36
7 changed files with 101 additions and 80 deletions
+9
View File
@@ -23,6 +23,7 @@ from .constants import (
)
from .options_stub import Options
from .rgb import Color, to_color
from .types import ConvertibleToNumbers
from .typing import AddressFamily, PopenType, Socket, StartupCtx
BASE = os.path.dirname(os.path.abspath(__file__))
@@ -632,3 +633,11 @@ class SSHConnectionData(NamedTuple):
binary: str
hostname: str
port: Optional[int] = None
def positive_int(x: ConvertibleToNumbers) -> int:
return max(0, int(x))
def positive_float(x: ConvertibleToNumbers) -> float:
return max(0, float(x))