Remove xpm support (no one really uses it, and IMAGETYPE_XPM is undefined, causing warnings)
Remove erroneous call to unlink in the constructor
This commit is contained in:
		
				
					committed by
					
						
						Brion Vibber
					
				
			
			
				
	
			
			
			
						parent
						
							b149b88953
						
					
				
				
					commit
					26ba430ae8
				
			@@ -67,10 +67,8 @@ class ImageFile
 | 
				
			|||||||
            $info[2] == IMAGETYPE_BMP ||
 | 
					            $info[2] == IMAGETYPE_BMP ||
 | 
				
			||||||
            ($info[2] == IMAGETYPE_WBMP && function_exists('imagecreatefromwbmp')) ||
 | 
					            ($info[2] == IMAGETYPE_WBMP && function_exists('imagecreatefromwbmp')) ||
 | 
				
			||||||
            ($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) ||
 | 
					            ($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) ||
 | 
				
			||||||
            ($info[2] == IMAGETYPE_XPM && function_exists('imagecreatefromxpm')) ||
 | 
					 | 
				
			||||||
            ($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) {
 | 
					            ($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            @unlink($_FILES[$param]['tmp_name']);
 | 
					 | 
				
			||||||
            throw new Exception(_('Unsupported image file format.'));
 | 
					            throw new Exception(_('Unsupported image file format.'));
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -161,9 +159,6 @@ class ImageFile
 | 
				
			|||||||
         case IMAGETYPE_XBM:
 | 
					         case IMAGETYPE_XBM:
 | 
				
			||||||
            $image_src = imagecreatefromxbm($this->filepath);
 | 
					            $image_src = imagecreatefromxbm($this->filepath);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
         case IMAGETYPE_XPM:
 | 
					 | 
				
			||||||
            $image_src = imagecreatefromxpm($this->filepath);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
         default:
 | 
					         default:
 | 
				
			||||||
            throw new Exception(_('Unknown file type'));
 | 
					            throw new Exception(_('Unknown file type'));
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
@@ -206,10 +201,6 @@ class ImageFile
 | 
				
			|||||||
            //we don't want to save XBM... it's a rare format that we can't guarantee clients will support
 | 
					            //we don't want to save XBM... it's a rare format that we can't guarantee clients will support
 | 
				
			||||||
            //save png instead
 | 
					            //save png instead
 | 
				
			||||||
            $this->type = IMAGETYPE_PNG;
 | 
					            $this->type = IMAGETYPE_PNG;
 | 
				
			||||||
        } else if($this->type == IMAGETYPE_XPM) {
 | 
					 | 
				
			||||||
            //we don't want to save XPM... it's a rare format that we can't guarantee clients will support
 | 
					 | 
				
			||||||
            //save png instead
 | 
					 | 
				
			||||||
            $this->type = IMAGETYPE_PNG;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $outname = Avatar::filename($this->id,
 | 
					        $outname = Avatar::filename($this->id,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user