-
Notifications
You must be signed in to change notification settings - Fork 11
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
No images displayed (using DocxConverter & JatsParser) #10
Comments
Hi @LoicE5, I see the error related to JATS XML parsing in the log. Have you noticed |
There are I made a GDrive folder with all the files for this example : https://drive.google.com/drive/folders/1HnFWpQysnU_V9mi-KhUWwU2Yk0qHoTfR?usp=sharing (The docx document comes from GDocs in this folder, I also tried with MS Word.) The issue might also be coming from JatsParser Plugin... Maybe a routing issue ? Here's the test journal with the element inspector :
In this process, we submit images as complementary files attached to the XML document during the production stage. I also noticed that files in the arborescence are renamed, including images... I tried to directly inject To sum up:
Thanks a lot for your help ! I will be happy to give you more details if you need them :) Loïc |
Thanks! Yes, look like JATS Parser Plugin is unable to pick up the correct path to the images in the system.
Can you also share with me any DOCX file with images inside that aren't correctly parsed to try the conversion chain to reproduce the error? |
Here's some files that I created specifically for test purposes, that contains images : DOCX created with Google Docs DOCX created with MS Word |
Hi @Vitaliy-1 , After some researches, I may have found a workaround that would allow images to be displayed in the DOM. This is using Texture. When you attach images to the XML file, then edit it with Texture, you can inspect the images using browser developer's tools. We then get a path with 4 GET parameters :
It would then be possible using the custom header plugin to use JavaScript to dynamically replace existing img's src's to the path above, with the relevant GET parameters (using a forEach loop). However, I cannot see any way to echo the I've located the place where the Do you have any idea about how I could echo in the HTML DOM the Thanks a lot for your help (and your involvment in the PKP community) ! Loïc |
Hi @LoicE5, I hope to take a look at the issue and examples tomorrow. JATS Parser's controller (handler) extends OJS's ArticleHandler and adds a method for operations with dependent files: https://github.com/Vitaliy-1/JATSParserPlugin/blob/90f9eb4813de35e275de78cb616fde7516c48554/FullTextArticleHandler.inc.php#L22. I'd start the debugging from this method to see if/where it fails. If I recall correctly,
Another crucial place is where the image path is built for the actual HTML and PDF: https://github.com/Vitaliy-1/JATSParserPlugin/blob/90f9eb4813de35e275de78cb616fde7516c48554/JatsParserPlugin.inc.php#L727. This method is called just before
The path is constructed here: https://github.com/Vitaliy-1/JATSParserPlugin/blob/90f9eb4813de35e275de78cb616fde7516c48554/JatsParserPlugin.inc.php#L739, the file id is the last there ( Texture plugin has its own handler and the logic may be slightly different. Let me know if you need more details. |
Regarding handlers: https://docs.pkp.sfu.ca/dev/documentation/en/architecture-handlers |
@LoicE5, I was able to reproduce the problem only for JATS Parser Plugin v. 2.1.9-3, which is intended to work with OJS 3.3 and added a fix to However, the test of |
Hi @Vitaliy-1, Thanks a lot for your reply and your precious help. The versions are, after re-check :
I’ve tested the path you mentioned above (.../journal/article/downloadFullTextAssoc/100/1000/1001) and it’s working at a glance. Thanks a lot for your work ! Loïc |
This narrows the problem down to the part of code that replaces the path to the image: https://github.com/Vitaliy-1/JATSParserPlugin/blob/stable-3_2_1/JatsParserPlugin.inc.php#L755-L763 |
Hi @LoicE5, Did you manage to figure out where the problem is? |
Hi @Vitaliy-1, I inspected your code and I have not been able to solve the issue. Thanks for your help anyway, and sorry for my late reply :) Have a nice day! |
Hi @LoicE5, Images are handled the same way is in the HTML galley. This path is replaced with the absolute before showing on the front-end. |
Finally had some time today to explore and found the problem in how a localized file name of the image is handled. It seems to arise not from JATSParser or DOCXConverter plugin. Hope to have some more information tomorrow. |
The problem was in the Texture plugin: pkp/texture#103 |
Thanks a lot @Vitaliy-1. We made a (very quick) fix with JS for our urgent problem. We'll come back to it for a future release. |
Hi @Vitaliy-1,
I am currently implementing the following workflow in OJS with two of your plugins : DocxConverter & JatsParser.
This entire process is working fine, with one exception : figures.
When I do upload the document, no images are displayed in the HTML or in the PDF.
Here's some processes that I tried
In every case, the DOCX document comes from MS Word or Google Docs.
I don't get any Fatal Errors in the Apache Log.
Would you have any advices regarding images display in DocxConverter & JatsParser ?
Thanks a lot by advance for your help !
Loïc
The text was updated successfully, but these errors were encountered: