Beispiel #1
0
 /**
  * Sets the image and its attributes from an html image
  * 
  * @param str The html image 
  *
  */
 protected function setImageAttributes()
 {
     $imageAttributes = getimagesize($this->attributes["fullImagePath"]);
     if (!is_array($imageAttributes)) {
         throw new RuntimeException(sprintf('%s isn\'t a valid image file.', basename($this->attributes["fullImagePath"])));
     }
     $this->attributes["realWidth"] = $imageAttributes[0];
     $this->attributes["realHeight"] = $imageAttributes[1];
     $this->attributes["imageType"] = $imageAttributes[2];
     $this->attributes["width"] = $this->attributes["realWidth"];
     $this->attributes["height"] = $this->attributes["realHeight"];
     $this->attributes["size"] = w3sCommonFunctions::formatFileSize($this->attributes["fullImagePath"]);
 }