Unable to view TIF files with Generic Javascript View

Hi

I made a custom application using the Generic Javascript View. Basically it consists of a div element with a plotly graph and a div with image elements. When the user hovers over a datapoint, the corresponding images is shown in the image div. I’ve tested the code in a development environment (using eclipse) and all seems to work fine. However, it doesn’t work in Knime with the Generic Javascript node. The images are TIF files. If I replace the TIF files by JPG files it does work. My conclusion is that the Generic Javascript node doesn’t support TIF files. Preferably I would like to use TIF, otherwise I have to make a lot of unnecessary changes to my framework.

I was wondering if there is any settings which I can change so Knime uses the same browser engine as my default browser (Chrome)? I’m using Knime 4.3 btw, not sure if that matters though? I found the following settings and tried some things, but so far nothing solved the issue:

  • Javascript Views. Current settings: “Bundled Chromium Browser (version 83)” and Bundled Headless Chromium (version 83)
  • General → Web Browser. Currently set to “Default system web browser” (which is Chrome according to the Default Apps settings in Windows)

Any suggestions?

Thanks

Hi,
Is your development environment also KNIME 4.3? Because we now have an embedded Chromium browser engine (CEF) and maybe that is why it works in your development environment?
Kind regards,
Alexander

1 Like

Hi Alexander
The development environment I was referring to is independent on Knime. It’s basically just html + js files which I open in a Chrome browser.
I noticed that in the JavaScript Views settings there is an option “Chromium Embedded Framework (CEF) browser”. I’ve tried this setting without success. I’ve also tried to use my own browser with the “Path to browser executable” settings, without success either.
Any suggestions? Or do you want me to share a test workflow?
Best
Ashgard

Hi Ashgard,
A test workflow + image would be great. I am happy to have a look.
Alexander

Hi Alexander
Thanks for your help. I’ve been able to find the issue. For some reason my dev environment allowed me to open local resources, but KNIME doesn’t (which is how it actually should be). More info here: javascript - Cannot open local file - Chrome: Not allowed to load local resource - Stack Overflow.
I have to make an API with an endpoint to get these images.
Thanks again for the help. This topic can be closed.
Best A

1 Like

Hi @AlexanderFillbrunn

On second thought the API will slow things down too much. Alternatively I can set a flag to allow the system to access local files, as explained here: https://chrome-allow-file-access-from-file.com/. I tried to set this up in KNIME, see below, but it didn’t work, maybe I did something wrong?

Best
Ashgard

Hi,
According to Wikipedia (Comparison of web browsers - Wikipedia) most browsers do not support TIFF and Chrome does not either. So I am a bit stumped that it does work for you outside of KNIME. I have attached a small workflow that I used to test this inside KNIME. It reads a tiff file from the workflow’s data directory, converts it to base64 and then embeds it into the Generic JS View’s output using a data URL. This is a way of showing local files without the need to open up the browser sandbox. Unfortunately it still does not work for tiff, though. I copied the same tag I generate in my workflow into a normal website using the Chrome developer tools and it also did not work. When I do the same with a jpg it works just fine, so the data URL is correct.
Kind regards,
Alexander

tiff.knwf (453.0 KB)

1 Like

Hi

I’m afraid you are right. Not sure why the eclipse browser supports tif file. It did put me on the wrong track. I will make an API endpoint to convert the file to jpg. That will solve the issue.

Thanks for your help

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.