Example #1
0
 /**
  * Overload of ezcImageAnalyzer::analyzeImage()
  * Creates a temporary local copy of the image file so that it can be analyzed
  *
  * @return void
  */
 public function analyzeImage()
 {
     $clusterHandler = eZClusterFileHandler::instance($this->filePath);
     $clusterHandler->fetch();
     parent::analyzeImage();
     if ($this->deleteLocal) {
         $clusterHandler->deleteLocal();
     }
 }
 public function testGetHandlerClasses()
 {
     ezcImageAnalyzer::getHandlerClasses();
 }
Example #3
0
 /**
  * Set the array of known handlers.
  *
  * Sets the available handlers. The array submitted must be indexed by
  * the handler classes names (attention: handler classes must extend
  * ezcImageAnalyzerHandler), assigned to an array of options for this
  * handler. Most handlers don't have any options. Which options a handler
  * may accept depends on the handler implementation.
  *
  * @param array(string=>array(string=>string)) $handlerClasses Handlers
  *                                                             and options.
  */
 public static function setHandlerClasses(array $handlerClasses)
 {
     ezcImageAnalyzer::$knownHandlers = $handlerClasses;
     ezcImageAnalyzer::$availableHandlers = null;
 }
<?php

require_once 'tutorial_autoload.php';
$tutorialPath = dirname(__FILE__);
ezcImageAnalyzer::setHandlerClasses(array('ezcImageAnalyzerImagemagickHandler' => array('binary' => '/usr/bin/identify')));
$image = new ezcImageAnalyzer($tutorialPath . '/img/imageanalysis_example_03.jpg');
echo "Image data:\n";
echo "MIME type:\t{$image->mime}\n";
echo "Width:\t\t{$image->data->width} px\n";
echo "Height:\t\t{$image->data->height} px\n";
echo "Filesize:\t{$image->data->size} b\n";
$comment = $image->data->comment == '' ? 'n/a' : $image->data->comment;
echo "Comment:\t{$comment}\n";