-
Notifications
You must be signed in to change notification settings - Fork 43
Add configs for DPI, Page Segmentation Mode, and Zotero non-linked attachments #41
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
Conversation
Not sure if you are interested in this @stweil but I got a response from the Zotero devs, and was able to get this PR fixed for Group Library + 'hard' attachments. Their API is currently incompatible with linked attachments in the Group Libraries section. I think it only would make sense for them to implement that in the context of network drives, so they probably won't address that. Docs:
I have confirmed that this PR works on an M1 macbook, and here is a new screenshot of the settings panel If you would be interested in merging, please confirm that it works on your device as well. I don't normally touch JS.
|
@danpf, thanks for your contribution. I am afraid that the ability to add the new PDFs as attachments rather than 'linked files' causes a conflict with the latest commit b61ca1f which addresses the same issue as far as I see, but does not support a user choice. I think it would be good to solve this first and handle DPI and PSM for Tesseract in an extra pull request. We could either revert @aborel's commit and use your code or try to update your code based on Git master. I don't know which way will be better. |
I'm sorry about the conflict, too! I think the proposed configurable settings are a valuable addition, and I'd like to integrate it through whatever path will be seen as most convenient. |
My current company doesn't use zotero, so feel free to adapt this as you see fit. I don't really have the time to update it unfortunately, as it has been more than a year since I looked at this. |
Thanks for the PR, and thanks for taking the time to reply here! |
e3cf968 integrates the proposed code for Zotero7 and Zotero6. I also noticed that I had broken 0.8.0 for Zotero6 users, I have fixed that as well. |
Should I prepare a new release 0.8.1? |
I have updated the README now, so I guess we're ready for the new release :-) |
Thought I'd take a stab at this.
Added outputDPI and outputAsCopyAttachment as configuration options.
It seems to work, but I'm unable to get it to work with group libraries - do you have any idea why that might be?
briefly:
It works when I have a pdf selected on my personal 'My library' sub-collection, but when I use it on something selected in a sub-collection in my 'group library' I get errors like (below). The errors happen with the zotero-ocr plugin as well so maybe I shouldn't be basing my logic off that plugin and that's my problem.
[JavaScript Error: "Parent item 1/4Q5DY97J not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 1537}]
My guess is that for some reason in group libraries parents are mangled in the database, but I'm not sure how to check or confirm.
because the code to me appears correct and this line
https://github.com/danpf/zotero-ocr/blob/9eb9a8ec9a5ada40be27d07ca6de847637c14d2b/chrome/content/zoteroocr.js#L105 seems to be returning the right stuff.
I made a post in zotero dev about the issue but didn't get a response:
https://groups.google.com/g/zotero-dev/c/LVmcjIMqYvA