• JPG preview failed

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #11703  by JanB
 
Hi

at the moment a face a strange error

At the preview tab I have a preview of nearly all extensions (incl some with a minor usage) but the only one that is failing is the JPG/JPEG preview
extensions that are working : BMP, TIFF, PNG, BMP, WMF , HTML including the office extensions DOC, XLS , PPT, PDF etc

I'm running:
OpenKM 5.1.7
CentOS 5.6
Image magick 6.7.1-0
SWF Tools 0.9.1
OpenOffice 3.1

OpenKM.cfg
Code: Select all
system.openoffice.path=/usr/lib/openoffice.org3
system.img2pdf=/usr/bin/convert
system.pdf2swf=/usr/local/bin/pdf2swf
system.imagemagick.convert=/usr/bin/convert
system.swftools.pdf2swf=/usr/local/bin/pdf2swf
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl=none
application.url=http://localhost:8080/OpenKM/com.openkm.frontend.Main/index.jsp
error message
Code: Select all
19:55:05,309 WARN  [ExecutionUtils] Abnormal program termination: 1
19:55:05,310 WARN  [ExecutionUtils] STDERR: Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

19:55:05,311 ERROR [ConverterServlet] /opt/openkm/cache/swf/fd546294-6d79-4563-9d1e-205b142a6c11.swf (No such file or directory)
java.io.FileNotFoundException: /opt/openkm/cache/swf/fd546294-6d79-4563-9d1e-205b142a6c11.swf (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:137)
        at com.openkm.servlet.frontend.ConverterServlet.service(ConverterServlet.java:168)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
19:55:05,448 ERROR [[ConverterServlet]] Servlet.service() for servlet ConverterServlet threw exception
com.openkm.frontend.client.OKMException: /opt/openkm/cache/swf/fd546294-6d79-4563-9d1e-205b142a6c11.swf (No such file or directory)
        at com.openkm.servlet.frontend.ConverterServlet.service(ConverterServlet.java:194)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:636)
In the ./configure list of ImageMagick I don't have any errors regarding to the JPG extension, all features are enabled
also all type are declared to CentOS (tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel)

I have tried a fresh install of imagemagick not using the "yum install imagemagick" but no succes at all
Anyone another brilliant idea?
Last edited by JanB on Thu Aug 04, 2011 11:00 am, edited 1 time in total.
 #11706  by rmm
 
you have a redundant declaration in your OpenKM.cfg.
Starting from openkm 5.1, it uses the following configuration

system.imagemagick.convert=/usr/bin/convert

remove the system.img2pdf=/usr/bin/convert

what openkm you are using?
=)
 #11708  by JanB
 
OpenKM 5.1.7 (see usage list in first e-mail)

For the redundant settings :
It has no effect to switch them on or off, the problem persist
I have tried both ways, with the old settings, new settings only but always the same result

All extensions are working , but not the JPG/JPEG files
However the convert on command line level is no problem
 #11711  by rmm
 
I had solve this problem, Have you tried to convert the files directly?
example: png to pdf, gif to png, etc?
If we have the same problem, you cannot convert files directly (using convert utility) when it involves jpeg?
If this problem occurs:

Wrong JPEG library version: library is 62, caller expect 70.

Then I suggest you have to install manually an old version of jpeg library. If you still have a problem, let me know.

nad =)
see this post of mine: http://forum.openkm.com/viewtopic.php?f=5&t=5201
 #11720  by jllort
 
On some Centos installation I've made we observate some problems with image magick and packages, as suggest rmm try using convert directly from the terminal and probably there you'll found the cause of the problem.
 #11723  by JanB
 
Hi

I have performed the following actions:

- First i have checked again the redundant lines in OpenKM.cfg
to make sure all related lines to system.imagemagick are disabled (img2pdf and
result - none

- second a have manually converted JPG to PNG and PDF by using [convert filename.jpg filename.png] or [convert filename.jpg filename.pdf]
result : files are created in the usr/bin folder and are readable

- third manually converted the PNG and PDF to SWF
no problem

I don't know how OpenKM is actually handling the convert of JPG files , in 1 or 2 steps
Manually i have to do it in 2 but i don't know the tricks in the source right now

At this moment i don't know for sure were the error comes from.
I can reproduce the status in centos 5.5 and it seems to be working

Anyone who have a suggestion, i'm happy to try

p.s. by accident i found that the extension .txt is also not previewed but this should be an openoffice conversion i think
please confirm
 #11724  by jllort
 
1- .txt file conversion was a problem that might yet be solved ( was older ). Could you try in our online demo ?
2- About converting
The system.imagemagick.convert must not be disabled ! must have path to convert ( ensure with the user you're executing openkm has grants to execute it ).

The internal code is :
Code: Select all
String tpl = Config.SYSTEM_IMAGEMAGICK_CONVERT + " ${fileIn}[0] ${fileOut}";
That means there's no special parameter set by default to conversion utility.

At this point we only can debug in deep OpenKM, take a look at http://wiki.openkm.com/index.php/Debugging_OpenKM and configure debug for class com.openkm.util.DocConverter or all package com.openkm.util
 #11725  by JanB
 
Hi

system.imagemagick was never disabled at all time , but i understand your reaction because the text was not really clear
I only disabled all old related systemsettings such as img2pdf

Ok but for now i have an task to do.
It's a jump into deep water but let's starting debugging

I will let you know the results

I also will test the TXT extension at the demo
 #11728  by jllort
 
I've tested txt this morning on demo and with document I tested has run correctly, if it's not your case tell us, and upload with file you've tryed. We'll be waiting for image preview feedback.
 #11733  by JanB
 
TXT file also passed my test (at the demo site) so this should be solved at next update (i'm running 5.1.7 now)
 #11735  by JanB
 
Attached the complete debug file

Debugging of JPG error starts at line 15477
Debugging of 2nd picture starts at 15959
Debugging of TXT file starts at 16025

I hope you can find the root cause of this error
Total server log
Added class com.openkm.util.DocConverter

(85.41 KiB) Downloaded 795 times
 #11756  by jllort
 
You can install our nightly build available at http://integration.openkm.com

Seems img to pdf is not created ? the inputstream error indicates the pdf file not exist or is not valid. On jboss/cahe/pdf must be the files for example if raises the error on creating /opt/openkm/cache/swf/fd546294-6d79-4563-9d1e-205b142a6c11.swf then must be some .pdf with same name under cache/pdf take a look on it to ensure converted file is right. If it's right try converting to swf in terminal. If not exists then the problem is on imagemagic conversion process.
 #11759  by JanB
 
Hi

installed OpenKM.war
cleared the PDF cache folder

Restarted OpenKM.
Worked like a charm (also for the TXT files)

Thanks for your help

Topic closed

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.