diff --git a/packages/jupyter-ai/jupyter_ai/context_providers/file.py b/packages/jupyter-ai/jupyter_ai/context_providers/file.py index 190002251..45619122d 100644 --- a/packages/jupyter-ai/jupyter_ai/context_providers/file.py +++ b/packages/jupyter-ai/jupyter_ai/context_providers/file.py @@ -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"