Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 14, 2024
1 parent d713fef commit a72b67e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jupyter-ai/jupyter_ai/context_providers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def get_file_type(self, filepath):
try:
with open(filepath, "rb") as file:
file_header = file.read(4)
if file_header == b"\x89PNG" or file_header == b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a":
if (
file_header == b"\x89PNG"
or file_header == b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
):
return ".png"
elif file_header == b"\xff\xd8\xff\xe0":
return ".jpg"
Expand Down

0 comments on commit a72b67e

Please sign in to comment.