-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__load_from_output_folder fails on MacOS because of .DS_Store file #9
Comments
Instead I would fix it by wrapping the image load call into a try/except to ignore non-image. It would be more pythonic and avoid having to maintain a file blacklist. I'll push a fix right now. |
I looked into it and I'll just ignore files that start with a '.' that way any hidden file won't be processed. |
See 8153911 does this solution solve your problem? |
Partly. This way we are assuming that the
|
Points taken, pdf2image should not expect the folder to be empty. I will fix this by having a unique identifier in every generated image so the folder will not matter as long as you have the required permissions. |
So f2b5b1b It fixes your problem by exclusively considering images generated by pdftoppm in the function call you made. You can now use and reuse the same folder (without cleaning it if you want) and it will not throw. Please tell me if that solve your problem. |
Well, it helps. |
On MacOS, whenever we use
convert_from_path
convert_from_bytes
functions, if we pass an
output_folder
they end up calling__load_from_output_folder
function.If we use an existing folder, already visited with the Finder app, the function fails saying that
.DS_Store
is not a valid image.The problem is that this file is created automatically by MacOS Finder app. My suggestion if that this can be fixed passing a list of files to be ignored. If you agree, I can make the pull request.
The text was updated successfully, but these errors were encountered: