OJS3: Problems with eLife Lens Article Viewer plugin

Hi,

I am using OJS version 3.1.2.0, and the lens article viewer. But when I upload the images to it, he saves them to me in the delivery, but they are not displayed in the lens viewfinder. I get a 404 error.

Regards…

Hi @diegomejia07,

Can you include information on where you uploaded the images in OJS, and how you’re referencing them from your XML?

(Also filed here: Error images lens article viewer · Issue #40 · asmecher/lensGalley · GitHub)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

Load the images from the layout of the galley, as is normally done.

image

The url is not transformed, this is why it does not work. When you click on that URL, the image does not open and is not displayed in the lens gallery view.

Hi @diegomejia07,

What was the file’s exact filename on your computer (from which you uploaded it), and how is it referred to in the XML?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
The name of the file on my computer is 2216-0280-iee-37-01-e09-gf1.jpg and this is how I see it in the XML:

image

But in the viewer it shows the url

image

Does not convert

It would have to look something like this http://domain/journal/article/download/article_id/galley_id/artworkfile_id

Hi @diegomejia07,

What do you get for the following database query?

SELECT * FROM submission_files WHERE LOWER(original_file_name) = '2216-0280-iee-37-01-e09-gf1.jpg';

Hi @asmecher

image

Hi @diegomejia07,

Hmm, I can’t spot any problems there.

The way this is supposed to work is that OJS will fetch a list of dependent files (including the images you want to replace), then look through the XML for mentions of those files by upload filename. If it finds a match, it’ll replace the filename with the URL that fetches that file.

You can see this code in plugins/generic/lensGalley/LensGalleyPlugin.inc.php in the _getXMLContents function.

I would suggest adding some debug information (e.g. using error_log) to see what files are being fetched, and whether or not the filenames could be replaced.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

This is de function
image

This is the error.log

image

Hi @asmecher,

Finally I could solve it by changing the calls to the xml arrays in the plugins / generic / lensGalley / LensGalleyPlugin.inc.php file, based on this change asmecher/lensGalley#36 add tests for text/xml mime type · asmecher/lensGalley@f708225 · GitHub

Thank you very much for the help.

Hi @diegomejia07,

Thanks for posting the solution! (I corrected the link to the commit – that is the correct one now, right?)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Yes, this is the link correct to the commit.

Thank you very much for the help.

Hi @asmecher,

I have problems with show images too. I try all that you say in the above post. The database is OK, the plugin is updated, I have no errors in PHP Log (except warnings), the name of the file is OK, etc. Just one difference, I can’t see the href to my picture and the Figure tab is hidden.

So, I am missing something? This is the first time I upload an XML file, and all is fine with the XML, but the Figure is not showing

This is the message in my PHP Log:

‘PHP message: PHP Warning: Declaration of DependentFilesGridHandler::authorize($request, $args, $roleAssignments) should be compatible with SubmissionFilesGridHandler::authorize($request, &$args, $roleAssignments) in /home/gayana/domains/gayana.cl/public_html/lib/pkp/controllers/grid/files/dependent/DependentFilesGridHandler.inc.php on line 20’, referer: https://gayana.cl/index.php/gn/workflow/index/15/5

Hi @t4x0n,

What version of OJS are you using? Have you applied any patches or changes?

I don’t know the Lens Reader codebase well, but I suspect that if the Figure tab isn’t working, then the XML is somehow written in a way Lens Reader doesn’t understand. Development stopped on Lens Reader some time ago, so it may be getting obsolete.

Regards,
Alec Smecher
Public Knowledge Project Team

I’m using OJS 3.2.1.1, no more changes or patches, just the official release from PKP website, in other post above (May '19) appear a Figure tab, and in the HTML code I can see but hidden, I think is hidden when not find a Figure like in my case… may be is getting obsolete as you say

Hi @t4x0n,

What did you do to make the images show since I have the same problem as yours.

Hi @diegomejia07

I am no longer using this plugins… I just was trying to use eLife Lens but never more trie it, sorry!

A post was split to a new topic: Problems with eLife Lens article viewer plugin