Skip Menu |

This queue is for tickets about the Image-Imlib2 CPAN distribution.

Report information
The Basics
Id: 11255
Status: resolved
Priority: 0/
Queue: Image-Imlib2

People
Owner: leon [...] astray.com
Requestors: guillomovitch [...] mandrake.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.03
Fixed in: (no value)



Subject: Image::Imlib2 trouble with imlib2 1.2.0
Image::Imlib2 1.0.3 perl version 5.8.6 linux 2.6.10, mandrake cooker Loading image is broken: [guillaume@pomerol ~]$ perl -MImage::Imlib2 -e 'my $file=shift; my $image = Image::Imlib2->load($file) or die($_)' image.jpg Died at -e line 1. Patching Image.xs to support all kind of errors susceptible to get reported (see attached patch) by imlib2 doesn't provide much info: [guillaume@pomerol ~]$ perl -MImage::Imlib2 -e 'my $file=shift; my $image = Image::Imlib2->load($file) or die($_)' image.jpg Image::Imlib2 load error: Unknown at -e line 1. I tested this for several formats supported by imlib2 (jpg, gif, tif). Bindings for other languages, such as php-imlib2, don't seem to be affected.
--- lib/Image/Imlib2.xs 2004-07-13 12:32:25.000000000 +0200 +++ lib/Image/Imlib2.xs.new 2005-01-27 13:36:00.681395879 +0100 @@ -106,6 +106,46 @@ if (err == IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT) { Perl_croak(aTHX_ "Image::Imlib2 load error: No loader for file format"); } + + if (err == IMLIB_LOAD_ERROR_PATH_TOO_LONG) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Path too long"); + } + + if (err == IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Path component non existant"); + } + + if (err == IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Path component not directory"); + } + + if (err == IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Path points outside address space"); + } + + if (err == IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Too many symbolic links"); + } + + if (err == IMLIB_LOAD_ERROR_OUT_OF_MEMORY) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Out of memory"); + } + + if (err == IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Out of file descriptors"); + } + + if (err == IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Permission denied to write"); + } + + if (err == IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Out of disk space"); + } + + if (err == IMLIB_LOAD_ERROR_UNKNOWN) { + Perl_croak(aTHX_ "Image::Imlib2 load error: Unknown"); + } RETVAL = image; } OUTPUT:
On my ubuntu box, Image::Imlib2 works fine. Anyway, I've released Image-Imlib2-1.04. See if it helps.
From: DON [...] cpan.org
[LBROCARD - Thu Feb 3 11:14:44 2005]: Show quoted text
> On my ubuntu box, Image::Imlib2 works fine.
Hrm.. ubuntu only has libimlib2-dev_1.1.2-2.1_amd64.deb Show quoted text
> Anyway, I've released Image-Imlib2-1.04. See if it helps.
Doesn't seem to help any. I'm still having the same issues on Debian. However, the corresponding C code works just fine. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293815 for the Debian bug.
[LBROCARD - Thu Feb 3 11:14:44 2005]: Show quoted text
> Anyway, I've released Image-Imlib2-1.04. See if it helps.
It doesn't, the problem is still here: [guillomovitch@n2 ~]$ perl -MImage::Imlib2 -e 'my $file=shift; my $image = Image::Imlib2->load($file) or die($_)' file.jpg Died at -e line 1. The Mandrake perl doesn't have thread support, I don't know for Debian one.
From: DON [...] cpan.org
Ok, so I've figured out (basically) where this bug is comming from: [copied from the debian bug report at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293815&msg=18 ] he loaders for libimlib2 need to link with libImlib2.so by default. This was apparently changed in 1.2.0 (see after the IRC conversation) <dondelelcaro> vorlon: well, maybe that's not what it is... I'm trying to understand why the loaders for Imlib2 would work fine with just Imlib2, but fail when I try to load them into perl <dondelelcaro> it's #293815 <dondelelcaro> there doesn't seem to be any obvious issues that I can see <dondelelcaro> (but then, I'm not an expert at dynamic libraries by any stretch of the imagination <vorlon> dondelelcaro: you're trying to load them directly into perl, or you're trying to load Imlib2 which is then loading the loaders? * trave11er senses a trick question <dondelelcaro> vorlon: load Imlib2 which is then loading the loaders <vorlon> if the latter, there's a possible issue if the loaders are trying to look up symbols in imlib2 but have not been linked against it, since symbols in a library linked by an application are in the search path by default, but symbols in a library that has itself been dlopen()ed are not. <dondelelcaro> well, even more complicated. load Image::Imlib2 which then loads Imlib2 which loads the loaders <vorlon> right, same problem. <vorlon> Are you getting undefined symbol errors, or no error at all? <dondelelcaro> vorlon: no error at all... <vorlon> what does ldd -d -r <loader.so> show? <dondelelcaro> vorlon: ah, excellent <dondelelcaro> undefined symbol: __imlib_GetTag (/usr/lib/imlib2/loaders/png.so) <vorlon> yep. <vorlon> so to be used in situations where imlib2 is being dlopen()ed, those loaders themselves need to be linked against imlib. <dondelelcaro> vorlon: ok... <dondelelcaro> cool... makes sense... and the fact that the perl module links against them isn't good enough, right? <dondelelcaro> rrr... links against libImlib2 <vorlon> right. When I say "imlib2 is being dlopen()ed", I mean "imlib2 is only linked to by something that's being dlopen()ed" <vorlon> either way, it doesn't end up in the master symbol list. <dondelelcaro> oh, ok... so when the next thing gets dlopen()ed it doesn't get to see the symbols loaded by something else that was dlopen()ed? <vorlon> right. <vorlon> unless you use a particular flag to dlopen() -- one that you should never, ever use. :) <dondelelcaro> vorlon: right. Ok, good. * dondelelcaro reassigns the bug to imlib2 with this conversation This probably needs to be taken care of upstream, because I've already heard reports of it breaking on Fedora, Mandrake, and Ubuntu. [Probably breaks elsewhere as well.] The following is basically the change that broke Imlib2 for perl: --- Makefile.in 2005-01-05 17:22:26.000000000 -0800 +++ ../../imlib2-1.2.0/src/modules/loaders/Makefile.in 2005-02-05 14:34:57.000000000 -0800 @@ -286,49 +268,54 @@ $(GIF_L) \ $(ZLIB_L) \ $(BZ2_L) \ -pnm.la argb.la bmp.la xpm.la tga.la lbm.la +pnm.la \ +argb.la \ +bmp.la \ +xpm.la \ +tga.la \ +lbm.la jpeg_la_SOURCES = loader_jpeg.c -jpeg_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -jpeg_la_LIBADD = @JPEGLIBS@ -lImlib2 +jpeg_la_LDFLAGS = -module -avoid-version +jpeg_la_LIBADD = @JPEGLIBS@ png_la_SOURCES = loader_png.c -png_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -png_la_LIBADD = @PNGLIBS@ -lImlib2 +png_la_LDFLAGS = -module -avoid-version +png_la_LIBADD = @PNGLIBS@ tiff_la_SOURCES = loader_tiff.c -tiff_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -tiff_la_LIBADD = @TIFFLIBS@ -lImlib2 +tiff_la_LDFLAGS = -module -avoid-version +tiff_la_LIBADD = @TIFFLIBS@ gif_la_SOURCES = loader_gif.c -gif_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -gif_la_LIBADD = @GIFLIBS@ -lImlib2 +gif_la_LDFLAGS = -module -avoid-version +gif_la_LIBADD = @GIFLIBS@ +zlib_la_SOURCES = loader_zlib.c +zlib_la_LDFLAGS = -module -avoid-version +zlib_la_LIBADD = @ZLIBLIBS@ +bz2_la_SOURCES = loader_bz2.c +bz2_la_LDFLAGS = -module -avoid-version +bz2_la_LIBADD = @BZ2LIBS@ pnm_la_SOURCES = loader_pnm.c -pnm_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -pnm_la_LIBADD = -lImlib2 +pnm_la_LDFLAGS = -module -avoid-version +pnm_la_LIBADD = argb_la_SOURCES = loader_argb.c -argb_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -argb_la_LIBADD = -lImlib2 +argb_la_LDFLAGS = -module -avoid-version +argb_la_LIBADD = bmp_la_SOURCES = loader_bmp.c -bmp_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -bmp_la_LIBADD = -lImlib2 +bmp_la_LDFLAGS = -module -avoid-version +bmp_la_LIBADD = xpm_la_SOURCES = loader_xpm.c -xpm_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -xpm_la_LIBADD = -lImlib2 +xpm_la_LDFLAGS = -module -avoid-version +xpm_la_LIBADD = tga_la_SOURCES = loader_tga.c -tga_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -tga_la_LIBADD = -lImlib2 -zlib_la_SOURCES = loader_zlib.c -zlib_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -zlib_la_LIBADD = @ZLIBLIBS@ -lImlib2 -bz2_la_SOURCES = loader_bz2.c -bz2_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -bz2_la_LIBADD = @BZ2LIBS@ -lImlib2 +tga_la_LDFLAGS = -module -avoid-version +tga_la_LIBADD = lbm_la_SOURCES = loader_lbm.c -lbm_la_LDFLAGS = -no-undefined -module -avoid-version -L$(top_builddir)/src -L$(top_builddir)/src/.libs -lbm_la_LIBADD = -lImlib2 +lbm_la_LDFLAGS = -module -avoid-version +lbm_la_LIBADD = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \
As the problem originated from imlib2, this ticket can be closed.