aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/services.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/resources/services.py')
-rw-r--r--pyblackbird_cc/resources/services.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pyblackbird_cc/resources/services.py b/pyblackbird_cc/resources/services.py
index 441f623..03c53af 100644
--- a/pyblackbird_cc/resources/services.py
+++ b/pyblackbird_cc/resources/services.py
@@ -19,14 +19,12 @@ def get_pdf_metadata_from_path(file_path: str) -> PDFMetadata:
:param file_path:
:return: PDFMetadata
"""
- if file_path is None:
- raise ValueError("file_path cannot be None")
if not os.path.isfile(file_path):
raise ValueError("file_path must be a file. {file_path} is not a file.")
reader = PdfReader(file_path)
n_pages = len(reader.pages)
file_size = os.path.getsize(file_path)
- #pdf.close()
+ # pdf.close()
return PDFMetadata(file_name=file_path, file_size=file_size, n_pages=n_pages)
@@ -36,8 +34,6 @@ def export_pages_as_images(file_path: str) -> list[str]:
:param file_path:
:return: List of paths to the JPEG images
"""
- if file_path is None:
- raise ValueError("file_path cannot be None")
output_dir = tempfile.mkdtemp() # Create a temporary directory
reader = PdfReader(file_path)
n_pages = len(reader.pages)