This is the condition checking for image files from uploaded forms and determine which file extension to apply ImageMagic functions.

 

                #####################################################################  
                // x-png = internet exploerer
                if($value['FileExt'][1] == 'png' || $value['FileExt'][1] == 'x-png'){
                    if(!$image = imagecreatefrompng($value['SourceFile'])){
                        if($value['Debug']) echo ShowError(1,$value['DebugMsg'].'<hr>FILE: '.__FILE__.'<br> LINE: '.__LINE__.'  imagecreatefrompng() FAILED...');
                        else echo ShowError(1,'ERROR #293 - IMAGE FAILED');
                    }else{
                        if($value['Debug']) $value['DebugMsg'] .= 'uploadFunctions.php - LINE: '.__LINE__.'   imagecreatefrompng WORKED...<BR>';
                    }
                }
                if($value['FileExt'][1] == 'jpg' || $value['FileExt'][1] == 'jpeg' || $value['FileExt'][1] == 'pjpeg'){
                    if(!$image = imagecreatefromjpeg($value['SourceFile'])){
                        #IF IMAGE IS NOT JPEG, MIGHT BE A GIF:
                        if($value['Debug']) echo ShowError(1,$value['DebugMsg'].'<hr>FILE: '.__FILE__.'<br> LINE: '.__LINE__.'  imagecreatefromjpeg() FAILED...');
                        else echo ShowError(1,'ERROR #300 - IMAGE FAILED');
                    }else{
                        if($value['Debug']) $value['DebugMsg'] .= 'uploadFunctions.php - LINE: '.__LINE__.'   imagecreatefromjpeg WORKED...<BR>';
                    }
                }
                if($value['FileExt'][1] == 'gif'){
                    if(!$image = imagecreatefromgif($value['SourceFile'])){
                        #IF IMAGE IS NOT GIF, MIGHT BE A JPEG:
                        if($value['Debug']) echo ShowError(1,$value['DebugMsg'].'<hr>FILE: '.__FILE__.'<br> LINE: '.__LINE__.'  imagecreatefromgif() FAILED...');
                        else echo ShowError(1,'ERROR #307 - IMAGE FAILED');
                    }else{
                        if($value['Debug']) $value['DebugMsg'] .= 'uploadFunctions.php - LINE: '.__LINE__.'   imagecreatefromgif WORKED...<BR>';
                    }
                }
                if($value['FileExt'][1] == 'bmp'){
                    if(!$image = imagecreatefromwbmp($value['SourceFile'])){
                        if($value['Debug']) echo ShowError(1,$value['DebugMsg'].'<hr>FILE: '.__FILE__.'<br> LINE: '.__LINE__.'  imagecreatefromwbmp() FAILED...');
                        else echo ShowError(1,'ERROR #312 - IMAGE FAILED');
                    }else{
                        if($value['Debug']) $value['DebugMsg'] .= 'uploadFunctions.php - LINE: '.__LINE__.'   imagecreatefromwbmp WORKED...<BR>';
                    }
                }