Skip to content

Commit 21db86a

Browse files
lesnik512Artur Shiriev
andauthored
import pyvips locally to try fixing bug with conversion (#24)
Co-authored-by: Artur Shiriev <me@shiriev.ru>
1 parent f831ff7 commit 21db86a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

safe_s3_storage/file_validator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import typing
44

55
import magic
6-
import pyvips # type: ignore[import-untyped]
76

87
from safe_s3_storage import exceptions
98
from safe_s3_storage.kaspersky_scan_engine import KasperskyScanEngineClient
@@ -74,6 +73,8 @@ def _should_convert_file(self, file_name: str) -> bool:
7473
return extension not in self.excluded_conversion_formats
7574

7675
def _convert_image(self, validated_file: ValidatedFile) -> ValidatedFile:
76+
import pyvips # type: ignore[import-untyped] # noqa: PLC0415
77+
7778
if not _is_image(validated_file.mime_type):
7879
return validated_file
7980

0 commit comments

Comments
 (0)