Files
perl-Image-Imlib2/Image-Imlib2-2.03.diff

54 lines
2.3 KiB
Diff

Adds additional error checking with useful errors when image loads fail in IMLIB
Index: libimage-imlib2-perl/lib/Image/Imlib2.xs
===================================================================
--- libimage-imlib2-perl.orig/lib/Image/Imlib2.xs 2011-10-15 17:19:35.000000000 -0700
+++ libimage-imlib2-perl/lib/Image/Imlib2.xs 2011-10-15 17:19:52.000000000 -0700
@@ -181,6 +181,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: