FreeImage jpeg library conflicts with system jpeg library

Bug #128026 reported by gk
2
Affects Status Importance Assigned to Milestone
freeimage (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: libfreeimage3

Version Info:
libfreeimage3 3.9.3-3
libjpeg62 6b-13
libogre-14 1.4.3-1

Description:
Freeimage static build of libJPEG conflict with the system jpg library meaning that FreeImage cannot be used alongside any library that uses the system JPEG library.

Error Message:
FreeImage error: 'JPEG parameter struct mismatch: library thinks size is 464, caller expects 428' when loading format JPEG terminate called after throwing an instance of 'int'

Reason to suspect conflict with libjpeg:
"A common error that users of the library sometimes stumble upon is "JPEG parameter struct mismatch: library thinks size is X, caller expects Y" where X and Y are some numbers in the range 400-500. The reason for the error is that the user is using a version of the header file, jpeglib.h, that is different from the version of the installed binaries."
[http://en.wikipedia.org/wiki/Libjpeg]

I am using libogre-14 and get this error when I try to load a jpeg.
If its not freeimage maybe should assign bug to libogre-14

Update:
Using -lOgreMain in the linker params ensures the Ogre libraries get linked first and solves the conflict with the jpeg library linked by wxWidgets.
BUT
If any wx component requires the the JPEG library then the same problem occurs in reverse.

Suggestion, FreeImage should use the same version of the JPEG library as is present on Ubuntu?

Would the maintainer like to comment on this?

gk (kellygp)
description: updated
gk (kellygp)
description: updated
gk (kellygp)
description: updated
gk (kellygp)
description: updated
Revision history for this message
gk (kellygp) wrote :

Related Error Messages:
FreeImage Dependancy linking to system instead of FreeImage: "JPEG parameter struct mismatch: library thinks size is 464, caller expects 428"
System JPEG dependancy linking to FreeImage JPG instead of system: "JPEG parameter struct mismatch: library thinks size is 428, caller expects 464"

Possible Solution:

Update the package!!

There is a news story on the FreeImage site dated "November 19th, 2007" that seems to have the problem solved in the next version.
http://freeimage.sourceforge.net/news.html

The new version use gcc visibility support to solve the problem.

Revision history for this message
gk (kellygp) wrote :

I see the next version of Ubuntu, 8.04 uses the same package, should definitely updated for that version.

Revision history for this message
Brian (barmstrong) wrote :

Hi Everyone,

Getting FreeImage working was a freakin nightmare. But I thougt I'd leave a trail for those who follow. If your production environment happens to be Ubuntu Gutsy like me then you might find this useful:

I got it up and going decently at first, gif's worked, but not jpegs. I eventually tracked down this link, which talks about some conflict with the jpeg library:
https://bugs.launchpad.net/ubuntu/+source/freeimage/+bug/128026

This had the solution:

http://pastie.org/pastes/104754

I don't know who put it there but it saved my bacon.

FYI, there were some other things i had to do to get that working. For example, I had to change line 8 to this:
apt-get source libjpeg6b

I also had to install some tools along the way as I got errors, such as:
sudo apt-get install liburi-perl
sudo apt-get install fakeroot

Also, after running line 23 I got an error like this:

Now signing changes and any dsc files...
signfile freeimage_3.9.3-3ubuntu1.dsc Brian Armstrong
gpg: skipped "Brian Armstrong ": secret key not available
gpg: [stdin]: clearsign failed: secret key not available
debsign: gpg error occurred! Aborting....
debuild: fatal error at line 1174:
running debsign failed
debuild returned 29
Couldn't run 'debuild -i\.git/ -I.git'

Which was only resolved by going and reading about gpg:
http://www.quantumlab.net/pine_privacy_guard/howto_setup_gpg.html

I had to go through the steps of "gpg --gen-key" and create a passphrase with that exact name and info "Brian Armstrong ". Before line 23 would run.

I have no idea what any of this does...personally I hate anything that invovles a "make install" to get it working (mostly because it never seems to work right).

I can't believe it's really this hard to get this working. Anyway, thanks to ImageScience for a cool program...I know it's not your fault FreeImage is so difficult.

Best of luck to everyone, and I really hope these things get easier over time for rails developers everywhere.
Brian
brian at startbreakingfree dot com

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 beta or later?

Changed in freeimage:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in freeimage:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.