Groups | Search | Server Info | Login | Register


Groups > comp.lang.perl.misc > #24901

Image::Imlib2 error

From Popping Mad <rainbow@colition.gov>
Newsgroups comp.lang.perl.misc
Subject Image::Imlib2 error
Date 2025-03-28 12:35 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <vs6j3s$9ap$1@reader1.panix.com> (permalink)

Show all headers | View raw


I have an old image gallery that uses this libary in apache2 and modperl

I made a small test program is it behaves like the server code

#!/usr/bin/perl
use warnings;

use Image::Imlib2;
my $image;
#my $pic =
qq(/usr/local/apache2/htdocs/images/2025_purim_amsterdam/DSC03652.JPG);
my $pic = qq(/home/ruben/20130303_133505.jpg);
if (-e $pic) {
 print STDERR "File Exists ==> $pic\n";
 $image = Image::Imlib2->load($pic);
}
$image->save("/home/ruben/out.jpg");

[ruben@www3 Image]$ ~/bin/testimlib.pl
File Exists ==> /home/ruben/20130303_133505.jpg
Image::Imlib2 load error: No loader for file format at
/home/ruben/bin/testimlib.pl line 10.

the load() method seems to no longer recognize the file types to decode
them.  It is very fustrating.  I looked at the code in

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi/Image/Imlib2.pm

I can't even see the method load or where it might be inherited from

package Image::Imlib2;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);

require Exporter;
require DynaLoader;

@ISA = qw(Exporter DynaLoader);

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
    TEXT_TO_RIGHT
    TEXT_TO_LEFT
    TEXT_TO_UP
    TEXT_TO_DOWN
    TEXT_TO_ANGLE
);
$VERSION = '2.03';

bootstrap Image::Imlib2 $VERSION;

Image::Imlib2->set_cache_size(0);

sub new_transparent {
    my ( $pkg, $x, $y ) = @_;
    my $pixel = pack( 'CCCC', 0, 0, 0, 0 );    # ARGB
    return Image::Imlib2->new_using_data( $x, $y, $pixel x ( $x * $y ) );
}

sub new_using_data {
    my ( $pkg, $x, $y, $data ) = @_;
    if ( defined $data && 4 * $x * $y == length $data ) {
        return $pkg->_new_using_data( $x, $y, $data );
    } else {
        return undef;
    }
}

sub autocrop {
    my $image = shift;
    my ( $x, $y, $w, $h ) = $image->autocrop_dimensions;
    return $image->crop( $x, $y, $w, $h );
}

1;



It is not that large really.

I do find it in the source code for the module in the C library

[ruben@www3 Image]$ pwd
/home/ruben/.cpan/build/Image-Imlib2-2.03-6/lib/Image
[ruben@www3 Image]$
[ruben@www3 Image]$ grep load ./*
./Imlib2.c:XS_EUPXS(XS_Image__Imlib2_load); /* prototype to pass
-Wmissing-prototypes */
./Imlib2.c:XS_EUPXS(XS_Image__Imlib2_load)
./Imlib2.c:                image = imlib_load_image_with_error_return
(filename, &err);
./Imlib2.c:                  Perl_croak(aTHX_ "Image::Imlib2 load error:
File does not exist");
./Imlib2.c:                  Perl_croak(aTHX_ "Image::Imlib2 load error:
File is directory");
./Imlib2.c:                  Perl_croak(aTHX_ "Image::Imlib2 load error:
Permission denied");
./Imlib2.c:                  Perl_croak(aTHX_ "Image::Imlib2 load error:
No loader for file format");
./Imlib2.c:XS_EUPXS(XS_Image__Imlib2_load_font); /* prototype to pass
-Wmissing-prototypes */
./Imlib2.c:XS_EUPXS(XS_Image__Imlib2_load_font)
./Imlib2.c:     "Image::Imlib2::load_font",
./Imlib2.c:    font = imlib_load_font(fontname);
./Imlib2.c:        (void)newXSproto_portable("Image::Imlib2::load",
XS_Image__Imlib2_load, file, "$$");
./Imlib2.c:        (void)newXSproto_portable("Image::Imlib2::load_font",
XS_Image__Imlib2_load_font, file,

I really need to fix this :(

I would appreciate any help I can get. I never put a C program in perl
code I don't even see how it inherited the load method or any
constructor for image types.

Back to comp.lang.perl.misc | Previous | NextNext in thread | Find similar


Thread

Image::Imlib2 error Popping Mad <rainbow@colition.gov> - 2025-03-28 12:35 -0400
  Re: Image::Imlib2 error Popping Mad <rainbow@colition.gov> - 2025-03-29 18:32 -0400
    Re: Image::Imlib2 error Popping Mad <rainbow@colition.gov> - 2025-03-30 06:33 -0400

csiph-web