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; }