Skip to content

Conversation

@yuming-long
Copy link
Contributor

Summary

Instead of manually checking filename with .pdf extension and return is_pdf = false -> use currently pdf library to read file content to decide if the file content is valid pdf

@awalker4
Copy link
Collaborator

Same comment as Unstructured-IO/unstructured-python-client#184 - can you also remove the console.warn and console.error in the catch block? Sending a doc file with those logs shows a scary exception from PDFDocument.load

@yuming-long yuming-long changed the title chore [RUDOLPH-98] Use pdf library to check file without extension chore Use pdf library to check file without extension Sep 26, 2024
Copy link
Collaborator

@awalker4 awalker4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yuming-long yuming-long enabled auto-merge (squash) September 27, 2024 16:04
@yuming-long yuming-long merged commit 4b38b39 into main Sep 27, 2024
2 checks passed
@yuming-long yuming-long deleted the yuming/RUDOLPH-98_pdf_split_not_relay_on_file_extend_js branch September 27, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants