getImageFromFile() public static method

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.
return array The image data of the file as an array
Example #1
0
         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) {