Skip to content

Commit dba46e5

Browse files
authored
fix pdf check (#3245)
1 parent b31e4d5 commit dba46e5

File tree

1 file changed

+1
-1
lines changed
  • libs/libcommon/src/libcommon/viewer_utils

1 file changed

+1
-1
lines changed

libs/libcommon/src/libcommon/viewer_utils/asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def is_valid_pdf(pdf_stream: Union[BufferedReader, BytesIO]) -> bool:
181181
current_position = pdf_stream.tell()
182182
try:
183183
pdf_stream.seek(0)
184-
return pdf_stream.read(5) == b"%PDF-"
184+
return b"%PDF" in pdf_stream.read(1000)
185185
finally:
186186
pdf_stream.seek(current_position)
187187

0 commit comments

Comments
 (0)