Skip to content
Snippets Groups Projects
Commit a3dba82b authored by Per Hedbor's avatar Per Hedbor
Browse files

Added 'ANY' to the list of modules to try in _decode. This probably means that...

Added 'ANY' to the list of modules to try in _decode. This probably means that a lot of other modules can be removed from the list

Rev: lib/modules/_Image.pmod/module.pmod:1.7
parent 7f663a44
Branches
Tags
No related merge requests found
//! module Image //! module Image
//! $Id: module.pmod,v 1.6 2000/02/24 01:11:22 marcus Exp $ //! $Id: module.pmod,v 1.7 2000/03/10 04:52:36 per Exp $
//! method object(Image.Image) load() //! method object(Image.Image) load()
//! method object(Image.Image) load(object file) //! method object(Image.Image) load(object file)
...@@ -46,7 +46,7 @@ mapping _decode( string data, mixed|void tocolor ) ...@@ -46,7 +46,7 @@ mapping _decode( string data, mixed|void tocolor )
}; };
if(!i) if(!i)
foreach( ({ "GIF", "JPEG", "XWD", "PNM" }), string fmt ) foreach( ({ "GIF", "JPEG", "XWD", "PNM", "RAS" }), string fmt )
{ {
catch { catch {
i = Image[fmt]->decode( data ); i = Image[fmt]->decode( data );
...@@ -57,7 +57,7 @@ mapping _decode( string data, mixed|void tocolor ) ...@@ -57,7 +57,7 @@ mapping _decode( string data, mixed|void tocolor )
} }
if(!i) if(!i)
foreach( ({ "XCF", "PSD", "PNG", "BMP", "TGA", "PCX", foreach( ({ "ANY", "XCF", "PSD", "PNG", "BMP", "TGA", "PCX",
"XBM", "XPM", "TIFF", "ILBM", "PS", "PVR", "XBM", "XPM", "TIFF", "ILBM", "PS", "PVR",
/* Image formats low on headers below this mark */ /* Image formats low on headers below this mark */
"HRZ", "AVS", "WBF", "HRZ", "AVS", "WBF",
...@@ -74,15 +74,6 @@ mapping _decode( string data, mixed|void tocolor ) ...@@ -74,15 +74,6 @@ mapping _decode( string data, mixed|void tocolor )
break; break;
} }
if(!i) // No image could be decoded at all.
return 0;
if( arrayp(tocolor) && (sizeof(tocolor)==3) && objectp(i) && objectp(a) )
{
Image.Image o = Image.Image( i->xsize(), i->ysize(), @tocolor );
i = o->paste_mask( i, a );
}
return ([ return ([
"format":format, "format":format,
"alpha":a, "alpha":a,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment