Image preview and thumbnail do not work

Symptoms

Preview and thumbnails of images do not work on a Windows system.

This also happens if you try to use the convert service from the webservice API.

Cause

To generate previews and thumbnails of images, an external program convert.exe (located at $TOMCAT_HOME/bin) is used. In this case, this program fails because it needs a 32-bit DLL file. You will see an error message in openkm.log like this one:

2016-08-29 10:50:27,546 [http-bio-0.0.0.0-8180-exec-234] WARN com.openkm.util.ExecutionUtils - Abnormal program termination: -1073741515
2016-08-29 10:50:27,547 [http-bio-0.0.0.0-8180-exec-234] WARN com.openkm.util.ExecutionUtils - CommandLine: [C:/openkm-dev/tomcat-7.0.27/bin/convert.exe, -thumbnail, 280x280>, -background, white, -flatten, C:\Users\OpenKM\AppData\Local\Temp\okm4569534357915233684.jpg, C:\openkm-dev\tomcat-7.0.27\repository\cache\thumbnail\properties\3f4e4f74-e51c-46c3-9276-012e034a1a7f.png]
2016-08-29 10:50:27,547 [http-bio-0.0.0.0-8180-exec-234] WARN com.openkm.util.ExecutionUtils - STDERR:
2016-08-29 10:50:27,547 [http-bio-0.0.0.0-8180-exec-234] WARN com.openkm.util.ExecutionUtils - STDOUT:
2016-08-29 10:50:27,551 [http-bio-0.0.0.0-8180-exec-234] ERROR c.o.s.frontend.ConverterServlet -
java.lang.RuntimeException:
 

Diagnosis

Try to run a conversion from the command line and you will see this error dialog:

After seeing the previous error dump, try to execute the program from the command line. To do this go to $TOMCAT_HOME/bin and execute the following command:

convert -thumbnail 280x280> -background white -flatten test.jpg test.png

Where test.jpg should be a valid image. The execution of the command will show the following error:

vcomp100.dll is missing.

Solution

By default, OpenKM comes with a 32-bit version of convert.exe. In most cases, although you may be on a 64-bit computer, it is better to install the 32-bit redistributable package (or both).

To fix the error it is necessary to install the required DLL. To do this, download and install Microsoft Visual C++ 2010 Redistributable Package:

Properties

Properties

Date

2016-08-29

Last update

2018-11-29

Applies to

  • Frontend
  • Web services

 

Keywords

  • AllVersions
  •