Skip to content

Commit

Permalink
imghdr->puremagic
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavchenko committed Nov 15, 2024
1 parent fb1b8f4 commit ecaad7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oda_api/data_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from sys import path_importer_cache, version_info

from io import StringIO, BytesIO
import imghdr
import puremagic
import os
import logging
from matplotlib import image as mpimg
Expand Down Expand Up @@ -850,7 +850,7 @@ def __init__(self, binary_data, name=None, metadata={}, file_path=None, write_on
else:
self.file_path = None
byte_stream = BytesIO(binary_data)
tp = imghdr.what(byte_stream)
tp = puremagic.what(byte_stream)
if tp is None:
raise ValueError('Provided data is not an image')
self.img_type = tp
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ dependencies = [
"astroquery",
"scipy",
"rdflib",
"black"
"black",
"puremagic"
]

[project.optional-dependencies]
Expand Down

0 comments on commit ecaad7c

Please sign in to comment.