Skip to content
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

UnsatisfiedLinkError in imageformats #29

Closed
boggiz opened this issue Nov 5, 2017 · 22 comments
Closed

UnsatisfiedLinkError in imageformats #29

boggiz opened this issue Nov 5, 2017 · 22 comments

Comments

@boggiz
Copy link

boggiz commented Nov 5, 2017

Hello,

I have tried to execute 0.3.3 release today but i have this exception error :
image
Yet the paths in windows and mcf2pdf.bat are good i not understand where is my error !
Could you help me ?
Thanks a lot

@albrechtf
Copy link
Owner

Could you please check if the file C:\Program Files\Photocite by CEWE\imageformats\qwebp.dll exists? If not, please check (and report) which version of the CEWE software you have installed. Thanks!

@albrechtf
Copy link
Owner

Oh, and please paste the output of the command java -version. It may be that you have a 32bit Java on a 64bit Windows (or the other way round)...

@boggiz
Copy link
Author

boggiz commented Nov 5, 2017

Here is some snapshots:

  1. The file exists :
    image

  2. CEWE version
    image

  3. Java Version
    image

Thanks a lot for your intervention

@albrechtf
Copy link
Owner

I was able to reproduce this (biggest problem was to get a windows machine for testing ;-)). Please check with latest release (https://github.com/albrechtf/mcf2pdf/releases/latest), and close this issue if fixed. Thanks!

@boggiz
Copy link
Author

boggiz commented Nov 6, 2017

Thank you very much for your speed. I will test this new release later this week.

@rbodziony
Copy link

rbodziony commented Nov 7, 2017

hi
I've checked with 6.2.5 version got same error with latest version
error :.
.... [DEBUG] net.sf.mcf2pdf.pagebuild.BitmapPageBuilder Creating full page image from page elements Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar y 'libwebp.dll': Native library (win32-x86-64/libwebp.dll) not found in resource .......

@rbodziony
Copy link

rbodziony commented Nov 7, 2017

ok so copying qwebp.dll from imageformats up 1 folder to libwebp.dll now got error like that ...

...
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText Rendering text
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Starting rendering of 60 pages
[INFO ] net.sf.mcf2pdf.Mcf2FoConverter Rendering pages 0+1...
[DEBUG] net.sf.mcf2pdf.pagebuild.BitmapPageBuilder Creating full page image from
page elements
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up func
tion 'WebPGetInfo': Can't find declared procedure.

    at com.sun.jna.Function.<init>(Function.java:208)
    at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
    at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
    at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:499)
    at com.sun.jna.Library$Handler.invoke(Library.java:199)
    at com.sun.proxy.$Proxy1.WebPGetInfo(Unknown Source)
    at net.sf.mcf2pdf.mcfelements.util.webp.Qt5Webp.loadWebPImage(Qt5Webp.ja

va:71)
at net.sf.mcf2pdf.mcfelements.util.ImageUtil.internalRead(ImageUtil.java
:270)
at net.sf.mcf2pdf.mcfelements.util.ImageUtil.readImage(ImageUtil.java:84
)
at net.sf.mcf2pdf.pagebuild.PageBackground.drawBackground(PageBackground
.java:76)
at net.sf.mcf2pdf.pagebuild.PageBackground.renderAsBitmap(PageBackground
.java:61)
at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(Bitma
pPageBuilder.java:77)
at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:240)
at net.sf.mcf2pdf.Main.main(Main.java:188)
.....

@albrechtf
Copy link
Owner

albrechtf commented Nov 7, 2017

Did you replace your libwebp.dll? I hope you backed it up :-) The libwebp.dll is expected to be directly in the installation directory of CEWE (and is NOT identical to qwebp.dll). Could you please paste your full error message from the first try? The full classpath listed there would give a hint where the DLL has been searched for. Thanks!

@rbodziony
Copy link

removed and reinstalled 6.25
after install thre is no libwebp.dll in installation dir
....
<
C:\Program Files\CEWE\CEWE Fotoswiat
dir lib*.dll

2017-10-02 12:20 1 666 048 libeay32.dll
2017-04-11 12:01 15 360 libEGL.dll
2017-04-11 12:01 2 520 064 libGLESv2.dll
2017-10-02 12:20 429 568 libhunspell.dll
2017-10-02 12:20 533 504 libjpeg62.dll

C:\Program Files\CEWE\CEWE Fotoswiat
.......

@rbodziony
Copy link

orginal error
.....
<
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar
y 'libwebp.dll': Native library (win32-x86-64/libwebp.dll) not found in resource
path ([file:/C:/tmp/33aorg/lib/jdom-1.1.jar, file:/C:/tmp/33aorg/lib/fop-1.0.ja
r, file:/C:/tmp/33aorg/lib/xmlgraphics-commons-1.4.jar, file:/C:/tmp/33aorg/lib/
batik-svg-dom-1.7.jar, file:/C:/tmp/33aorg/lib/batik-anim-1.7.jar, file:/C:/tmp/
33aorg/lib/batik-parser-1.7.jar, file:/C:/tmp/33aorg/lib/batik-bridge-1.7.jar, f
ile:/C:/tmp/33aorg/lib/batik-script-1.7.jar, file:/C:/tmp/33aorg/lib/batik-js-1.
7.jar, file:/C:/tmp/33aorg/lib/batik-xml-1.7.jar, file:/C:/tmp/33aorg/lib/xalan-
2.6.0.jar, file:/C:/tmp/33aorg/lib/batik-awt-util-1.7.jar, file:/C:/tmp/33aorg/l
ib/batik-gvt-1.7.jar, file:/C:/tmp/33aorg/lib/batik-transcoder-1.7.jar, file:/C:
/tmp/33aorg/lib/batik-extension-1.7.jar, file:/C:/tmp/33aorg/lib/batik-ext-1.7.j
ar, file:/C:/tmp/33aorg/lib/commons-io-1.3.1.jar, file:/C:/tmp/33aorg/lib/avalon
-framework-api-4.3.1.jar, file:/C:/tmp/33aorg/lib/avalon-framework-impl-4.3.1.ja
r, file:/C:/tmp/33aorg/lib/batik-svggen-1.7.jar, file:/C:/tmp/33aorg/lib/batik-u
til-1.7.jar, file:/C:/tmp/33aorg/lib/xml-apis-1.3.04.jar, file:/C:/tmp/33aorg/li
b/batik-swing-1.7.jar, file:/C:/tmp/33aorg/lib/batik-css-1.7.jar, file:/C:/tmp/3
3aorg/lib/batik-dom-1.7.jar, file:/C:/tmp/33aorg/lib/batik-gui-util-1.7.jar, fil
e:/C:/tmp/33aorg/lib/xml-apis-ext-1.3.04.jar, file:/C:/tmp/33aorg/lib/batik-code
c-1.7.jar, file:/C:/tmp/33aorg/lib/commons-digester3-3.1.jar, file:/C:/tmp/33aor
g/lib/commons-logging-1.1.1.jar, file:/C:/tmp/33aorg/lib/commons-beanutils-1.8.3
.jar, file:/C:/tmp/33aorg/lib/commons-cli-1.2.jar, file:/C:/tmp/33aorg/lib/log4j
-1.2.9.jar, file:/C:/tmp/33aorg/lib/jempbox-1.6.0.jar, file:/C:/tmp/33aorg/lib/m
etadata-extractor-2.9.1.jar, file:/C:/tmp/33aorg/lib/xmpcore-5.1.2.jar, file:/C:
/tmp/33aorg/lib/pngj-2.1.0.jar, file:/C:/tmp/33aorg/lib/jna-4.1.0.jar, file:/C:/
tmp/33aorg/lib/jna-platform-4.1.0.jar, file:/C:/tmp/33aorg/lib/junit-4.11.jar, f
ile:/C:/tmp/33aorg/lib/hamcrest-core-1.3.jar, file:/C:/tmp/33aorg/lib/jai-imagei
o-core-1.3.0.jar, file:/C:/Program%20Files/CEWE/CEWE%20Fotoswiat/, file:/C:/tmp/
33aorg/mcf2pdf-0.3.3a.jar])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at net.sf.mcf2pdf.mcfelements.util.webp.Qt5Webp.loadLibrary(Qt5Webp.java
:43)
at net.sf.mcf2pdf.mcfelements.util.ImageUtil.internalRead(ImageUtil.java
:267)
at net.sf.mcf2pdf.mcfelements.util.ImageUtil.readImage(ImageUtil.java:84
)
at net.sf.mcf2pdf.pagebuild.PageBackground.drawBackground(PageBackground
.java:76)
at net.sf.mcf2pdf.pagebuild.PageBackground.renderAsBitmap(PageBackground
.java:61)
at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(Bitma
pPageBuilder.java:77)
at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:240)
at net.sf.mcf2pdf.Main.main(Main.java:188)
....

@albrechtf
Copy link
Owner

Finally, CEWE seems to react to Mcf2Pdf :-) With 6.2.4, it should work - I installed it just two days ago on a Windows machine. I have no clue why they removed that library from 6.2.5...

As a workaround, you could manually download libwebp.dll and copy it to the installation directory of CEWE - it is a free open source library, you can e.g. download it here: http://www.kopf.com.br/kaplof/libwebp-dll-binaries-for-windows-download-missing/

I will check if the licenses are compatible and perhaps include binaries of this DLL for Windows and Linux in the Mcf2Pdf package.

@boggiz
Copy link
Author

boggiz commented Nov 7, 2017

I am on Windows 7 (64b) and I encountered this dll problem this morning. I downloaded it and installed it in Windows \ System32.
I converted a file without problem with the CEWE 6.02.04 release which is the latest available in France.
Thanks again for your efficiency

@boggiz
Copy link
Author

boggiz commented Nov 7, 2017

Here is the link for the dll : https://fr.dll-files.com/libwebp.dll.html

@albrechtf
Copy link
Owner

Libraries included for Windows x64 and Linux x64. For Mac OS X, you should install the libwebp package into the system (see Release Notes).

Feedback is appreciated; please close the issue if it is now fixed for you. Thanks!

@rbodziony
Copy link

hi
so good is is now starting working so you can close this issue
2nd is crashing during processing ( i ll open new issue)
Thx

@boggiz
Copy link
Author

boggiz commented Nov 12, 2017

Hello,
I think you need to provide 2 dll for Windows one 32bits and the other in 64bits because with this version 0.3.4 I have a new error:
image

When I analyze the dependency hierarchy of your libwebp.dll an error pops up stating that the MSVCR110.DLL dll does not exist on my Windows 7 64-bit sp1 system:
image

The dll I mentioned in my previous post is a 64b as indicated in the snapshot below:
image
It is therefore necessary to put the 2 dll in the java file and choose the one to use during the execution ...
Thank's

@aschue
Copy link

aschue commented Jan 26, 2018

I had the same issue on Windows 10 (64bit), using the 0.3.4 release.
The mcf software I am using is dm-Fotowelt 6.3.1 (x64), and Java version 1.8.0_161.

I could fix it by downloading the library from the website that @boggiz posted earlier

Here is the link for the dll : https://fr.dll-files.com/libwebp.dll.html

, and copying it into the installation directory of the mcf software. I had to use the 32 bit version for it to work, though.

@bertramakers
Copy link

For Mac OS X, you should install the libwebp package into the system (see Release Notes).

Ran into the same issue on macOS. Installed webp using Homebrew and now have cwebp and dwebp available as commands in the Terminal.

Also have a libqwebp.dylib file in the imageformats directory.

Still getting the following error:

[INFO ] net.sf.mcf2pdf.Mcf2FoConverter Rendering cover...
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libwebp.so': Native library (darwin/liblibwebp.so.dylib) not found in resource path (lib/libwebp.jar:lib/jdom-1.1.jar:lib/fop-1.0.jar:lib/xmlgraphics-commons-1.4.jar:lib/batik-svg-dom-1.7.jar:lib/batik-anim-1.7.jar:lib/batik-parser-1.7.jar:lib/batik-bridge-1.7.jar:lib/batik-script-1.7.jar:lib/batik-js-1.7.jar:lib/batik-xml-1.7.jar:lib/xalan-2.6.0.jar:lib/batik-awt-util-1.7.jar:lib/batik-gvt-1.7.jar:lib/batik-transcoder-1.7.jar:lib/batik-extension-1.7.jar:lib/batik-ext-1.7.jar:lib/commons-io-1.3.1.jar:lib/avalon-framework-api-4.3.1.jar:lib/avalon-framework-impl-4.3.1.jar:lib/batik-svggen-1.7.jar:lib/batik-util-1.7.jar:lib/xml-apis-1.3.04.jar:lib/batik-swing-1.7.jar:lib/batik-css-1.7.jar:lib/batik-dom-1.7.jar:lib/batik-gui-util-1.7.jar:lib/xml-apis-ext-1.3.04.jar:lib/batik-codec-1.7.jar:lib/commons-digester3-3.1.jar:lib/commons-logging-1.1.1.jar:lib/commons-beanutils-1.8.3.jar:lib/commons-cli-1.2.jar:lib/log4j-1.2.9.jar:lib/jempbox-1.6.0.jar:lib/metadata-extractor-2.9.1.jar:lib/xmpcore-5.1.2.jar:lib/pngj-2.1.0.jar:lib/jna-4.1.0.jar:lib/jna-platform-4.1.0.jar:lib/junit-4.11.jar:lib/hamcrest-core-1.3.jar:lib/jai-imageio-core-1.3.0.jar:/Applications/Kruidvat fotoservice.app/Contents/:mcf2pdf-0.3.4.jar)
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
	at com.sun.jna.Library$Handler.<init>(Library.java:147)
	at com.sun.jna.Native.loadLibrary(Native.java:412)
	at com.sun.jna.Native.loadLibrary(Native.java:391)
	at net.sf.mcf2pdf.mcfelements.util.webp.Webp.loadLibrary(Webp.java:42)
	at net.sf.mcf2pdf.mcfelements.util.ImageUtil.internalRead(ImageUtil.java:267)
	at net.sf.mcf2pdf.mcfelements.util.ImageUtil.readImage(ImageUtil.java:84)
	at net.sf.mcf2pdf.pagebuild.PageBackground.drawBackground(PageBackground.java:76)
	at net.sf.mcf2pdf.pagebuild.PageBackground.renderAsBitmap(PageBackground.java:61)
	at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(BitmapPageBuilder.java:77)
	at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:211)
	at net.sf.mcf2pdf.Main.main(Main.java:188)

Note that /Applications/Kruidvat fotoservice.app is just a rebranded version of CEWE. (I got it to work with a much simpler book with only 2 photos to test - I just can't convert a large book that I'd actually like to convert to pdf.)

@rbodziony
Copy link

Can you check this https://github.com/rbodziony/mcf2pdf/releases/tag/0.3.6 version with enabled debug and provide it ?

@bertramakers
Copy link

Do I have to build it myself to enable debugging or is it enabled by default in the provided binaries?
I tried running the Linux binary from the link you provided but had to convert the line endings in the script first, following the steps provided here: https://stackoverflow.com/a/23097540
Got the script running but still got the same error though. No extra debugging output printed.

If I have to build it myself, can you provide some instructions? I'm not familiar with building Java applications.

@rbodziony
Copy link

Hmm can you show how you run it ?
To enable debug log use -d switch

@rbodziony
Copy link

Also pls show output how you installed webp and version cwebp and dwebp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants