Example #1
0
 static function testCreateVMSGImage()
 {
     $vimage = new VSMGImage('../test/images/1.jpeg', 150, 150);
     $img_info = getimagesize($vimage->getThumbnail());
     assert($img_info[0] == 150);
     assert($img_info[1] == 150);
 }
Example #2
0
 /**
  * Generate a collection of VSMGImages from a collection of original image
  * file paths
  *
  * @param $files
  * 	A collection of file paths to images
  */
 function generateVSMGImages($files)
 {
     unset($this->all_vimages);
     $this->all_vimages = array();
     foreach ($files as $image_path) {
         $vimage = new VSMGImage($image_path, $this->default_thumb_width, $this->default_thumb_height);
         if ($vimage->getMimeType() != NULL) {
             array_push($this->all_vimages, $vimage);
         }
     }
     if ($this->use_serialised === TRUE) {
         $this->createEntriesSerialised();
     } else {
         $this->createEntries();
     }
 }