Ejemplo n.º 1
0
 /**
  * creates the lineitem object. $dblineitem is the database object of this line item
  *
  * @param string $foldername
  * @param string $filename
  */
 function __construct($foldername, $filename = null)
 {
     if (is_object($foldername)) {
         $this->_file = $foldername;
         $foldername = $this->_file->folder;
         $filename = $this->_file->file;
     }
     parent::__construct($foldername, $filename);
     $app = JFactory::getApplication();
     $params = null;
     if ($app instanceof JSite) {
         /**
          * @var JSite $app
          */
         $params = JComponentHelper::getParams('com_eventgallery');
     } else {
         $params = JComponentHelper::getParams('com_eventgallery');
     }
     if ($params->get('use_legacy_image_rendering', '0') == '1') {
         $this->_image_script_path = "index.php";
     }
     if (isset($this->_file->exif)) {
         $this->exif = json_decode($this->_file->exif);
     } else {
         $this->exif = new stdClass();
     }
 }
Ejemplo n.º 2
0
 /**
  * creates the lineitem object. The foldername can either be a string or a file data object
  *
  * @param string|object $foldername
  * @param string $filename
  */
 function __construct($foldername, $filename = NULL)
 {
     if (is_object($foldername)) {
         $this->_file = $foldername;
         /**
          * @var EventgalleryLibraryManagerFolder $folderMgr
          */
         $folderMgr = EventgalleryLibraryManagerFolder::getInstance();
         $this->_folder = $folderMgr->getFolder($foldername->folder);
     } else {
         parent::__construct($foldername, $filename);
     }
     if (isset($this->_file->height)) {
         $this->imageRatio = $this->_file->width / $this->_file->height;
     } else {
         $this->imageRatio = 1;
     }
 }