getImageFromFile() 공개 정적인 메소드

Read an image from the filesystem.
public static getImageFromFile ( string $file, array $override = [] ) : array
$file string The filename of the image.
$override array Overwrite the file array with these values.
리턴 array The image data of the file as an array
예제 #1
0
파일: xppublish.php 프로젝트: horde/horde
         if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
             $error = _("Access denied adding photos to this gallery.");
         } else {
             $error = false;
         }
     } catch (Ansel_Exception $e) {
         $error = _("There was an error accessing the gallery.");
     }
 }
 if (!$name || $error) {
     $error = _("No file specified");
 } else {
     try {
         $GLOBALS['browser']->wasFileUploaded('imagefile', _("photo"));
         try {
             $image = Ansel::getImageFromFile($file, array('image_filename' => $name));
         } catch (Ansel_Exception $e) {
             $error = $e->getMessage();
         }
         $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($galleryId);
         try {
             $image_id = $gallery->addImage($image);
             $error = false;
         } catch (Ansel_Exception $e) {
             $error = _("There was a problem uploading the photo.");
         }
     } catch (Horde_Browser_Exception $e) {
         $error = $e->getMessage();
     }
 }
 if ($error) {