Exemple #1
0
 function getImageFile()
 {
     if (!($img_name = $this->getImageFileName())) {
         return false;
     }
     require_once 'AMP/System/File/Image.php';
     $image = new AMP_System_File_Image(AMP_image_path($img_name));
     $image->set_display_metadata($this->getImageData());
     return $image;
 }
Exemple #2
0
 function commitActionLocal(&$target_set, $action, $args = null)
 {
     if ($action != 'recalculate') {
         return false;
     }
     $image_finder = new AMP_System_File_Image();
     $targets = $image_finder->find(array('path' => AMP_LOCAL_PATH . '/img/original/'));
     $this->recalculate($targets, $args);
     return true;
 }
Exemple #3
0
 function _update_image_cache_delete($image_name)
 {
     $imageRef = new AMP_System_File_Image(AMP_image_path($image_name, AMP_IMAGE_CLASS_ORIGINAL));
     $image_cache_key = $imageRef->getCacheKeySearch();
     $image_cache =& AMP_cache_get($image_cache_key);
     if (!$image_cache) {
         return;
     }
     unset($image_cache[$image_name]);
     AMP_cache_set($image_cache_key, $image_cache);
 }
Exemple #4
0
 function load_db_image($filename)
 {
     require_once 'AMP/System/File/Image.php';
     $image = new AMP_System_File_Image($this->getPath($this->getImageClass()));
     /*
             $image = $image_finder->find( array( 'name' => $filename ));
             if ( !$images ) return false;
             $image = current( $images );
     */
     $data = $image->getData();
     $keys = array_keys($data);
     foreach ($keys as $key) {
         $this->_addAllowedKey($key);
     }
     $this->setData($image->getData());
 }
Exemple #5
0
 function setImageFile($filename)
 {
     if (!file_exists($filename)) {
         return false;
     }
     $image_ref = new AMP_System_File_Image($filename);
     if (array_search($image_ref->get_mimetype(), $this->_allowed_mimetypes) === FALSE) {
         $this->addError(AMP_TEXT_ERROR_IMAGE_NOT_ALLOWED);
         return false;
     }
     $this->_paths = array(AMP_IMAGE_CLASS_OPTIMIZED => AMP_image_path($image_ref->getName(), AMP_IMAGE_CLASS_OPTIMIZED), AMP_IMAGE_CLASS_THUMB => AMP_image_path($image_ref->getName(), AMP_IMAGE_CLASS_THUMB), AMP_IMAGE_CLASS_ORIGINAL => AMP_image_path($image_ref->getName(), AMP_IMAGE_CLASS_ORIGINAL), AMP_IMAGE_CLASS_CROP => AMP_image_path($image_ref->getName(), AMP_IMAGE_CLASS_CROP));
     $image_ref->getFilename();
     $this->_image_ref =& $image_ref;
     $this->_initCrop();
     $this->_setWidths();
     return true;
 }
Exemple #6
0
 function &getImageFile()
 {
     $false = false;
     if (!($name = $this->getImageFileName())) {
         return $false;
     }
     $img_class = $this->getImageClass();
     if (!$img_class) {
         $img_class = AMP_IMAGE_CLASS_OPTIMIZED;
     }
     $image = new AMP_System_File_Image(AMP_image_path($name, $img_class));
     if (!$image->getPath()) {
         return $false;
     }
     $image->set_display_metadata($this->getImageData());
     return $image;
 }
Exemple #7
0
 function _showThumbNail($data, $column)
 {
     $column = 'name';
     if (!(isset($data[$column]) && $data[$column])) {
         return false;
     }
     require_once 'AMP/System/File/Image.php';
     $image_file = new AMP_System_File_Image(AMP_image_path($data[$column]));
     if (!($path = $image_file->getPath())) {
         return $data[$column];
     }
     $this->dropField('filename');
     $this->dropField('image');
     $renderer = AMP_get_renderer();
     return $data[$column] . $image_file->display->execute();
     /*
             $renderer = AMP_get_renderer( );
             return $renderer->link( $content_image->getURL( AMP_IMAGE_CLASS_ORIGINAL ), $renderer->image( $content_image->getURL( AMP_IMAGE_CLASS_OPTIMIZED)), array( 'target' => '_blank'))
      . $renderer->newline( )
     .  $renderer->link( $content_image->getURL( AMP_IMAGE_CLASS_ORIGINAL ), $data[$column], array( 'target' => '_blank'));
     */
 }