@param string $filename

@throws \livetyping\hermitage\foundation\exceptions\ImageNotFoundException
175580
protected function makeVersion(string $filename)
    {
        $original = Util::original($filename);
        $command = new MakeImageVersionCommand($original, Util::version($filename));

        $this->bus->handle($command);
    }
497752
public static function open($fileName)
    {
        self::checkRequirements();

        if (!file_exists($fileName) || !is_readable($fileName))
            throw new Exception('Could not open file: '.$fileName);

        $type = self::detectArchiveType($fileName);
        if (!self::canOpenType($type)) {
            return null;
        }

        return new self($fileName, $type);
    }
169298
public function handleDelete(string $fileName): void
	{
		if ($this->presenter->isAjax() && $this->editable) {
			$file = $this->getFileInfo($fileName);
			if ($file->isDir) {
				File::removeDir($this->getFullPath($file->name));
			} else {
				unlink($this->getFullPath($file->name));
			}
			$this->redrawControl('fileManagerContainer');
		} else {
			exit;
		}
	}
962129
public function deleteFileByName($filename)
    {
        $destinationPath = $this->getDestinationPath();
        $destination = $destinationPath . '/' . $filename;

        if (file_exists($destination)) {
            $files = $this->getFiles();
            foreach ($files as $key => $file) {
                if ($file->file == $filename) {
                    unlink($destination);
                    unset($files[$key]);
                }
            }

            $files = array_values($files);
            $this->repository->files = $files;
            $this->save();
        }
    }
189806
public function load($filename)
    {
        if ($filename && file_exists($filename)) {
            $this->doc->load($filename, LIBXML_NSCLEAN);
        } else {
            $this->createBasicDocument();
        }
    }
284110
static public function createFromFile($pathname)
    {
        if (!file_exists($pathname)) {
            throw new ImageFileNotFoundException($pathname);
        }
        $ii = getimagesize($pathname);
        $width = $ii[0];
        $height = $ii[1];
        $imagetype = $ii[2];
        $last_modified = filemtime($pathname);
        $exif = @exif_read_data($pathname);
        if (isset($exif['Orientation'])) {
            $orientation = $exif['Orientation'];
        } else {
            $orientation = 0;
        }
        return new static($pathname, $width, $height, $imagetype, $last_modified, $orientation);
    }
6557
public static function load(string $filename) {
		if(class_exists(Dotenv::class)) {
			$dotenv = new Dotenv($filename);
			$dotenv->load();
		}
	}
889416
protected function deleteFile($fileName)
    {
        if (null !== $fileName && $this->mediaStorageManager->exists($fileName)) {
            $this->mediaStorageManager->deleteContent($fileName);
        }
    }
1276540
public function getFilePath($filename)
    {
        if (!strpos($filename, '.')) {
            $filename .= ".phtml";
        }

        foreach ($this->config->getPaths() as $path) {
            $file = "$path/$filename";

            if (file_exists($file)) {
                return $file;
            }
        }

        throw new FileNotFoundException(
            'File \'' . $filename . '\' was not found.'
        );
    }
1230824
public function addCSS($filename)
    {
        if (($css = @file_get_contents($filename)) === false) {
            throw new \Exception('Invalid css file path provided.');
        }
        $this->css .= $css;
    }
830013
public function resizeAction($imageName)
    {
        try {
            $imageOptimizer = $this->get('harentius_blog.image_optimizer');
            $imagePath = $imageOptimizer->createPreviewIfNotExists($imageName);

            return new BinaryFileResponse($imagePath);
        } catch (\Exception $e) {
            throw new NotFoundHttpException(sprintf('File %s not found', $imageName));
        }
    }
79717
public function handleDownload(string $fileName): void
	{
		$file = $this->getFileInfo($fileName);
		if ($file->isDir) {
			$archive = new TempFile;
			File::zip($this->getFullPath($file->name), (string) $archive);
			$response = new FileResponse($archive, $file->name . '.zip');
		} else {
			$response = new FileResponse($this->getFullPath($file->name));
		}
		$this->presenter->sendResponse($response);
	}
1178449
public function writeTo($filename)
    {
        parent::writeTo($filename);
        
        if ($this->optimiserService instanceof ImageOptimiserInterface) {
            $this->optimiserService->optimiseImage($filename);
        }
    }
829837
public function removeFile($filename) {
		if( ($key = array_search($filename, $this->attachedFiles)) === false ) {
			throw new \Exception('FileNotContained');
		}
		unset($this->attachedFiles[$key]);
	}
489785
protected function assertFileIsReadable(string $fileName): void
    {
        if (!is_file($fileName) || !is_readable($fileName)) {
            throw new InvalidPathException(sprintf('Unable to read the file at %s', $fileName));
        }
    }
320808
public static function loadFile($filename)
    {
        if (class_exists(\PHPUnit\Util\Fileloader::class)) {
            // PHPUnit 6.x
            \PHPUnit\Util\Fileloader::checkAndLoad($filename);
        } else {
            // PHPUnit 7.x+
            \PHPUnit\Util\FileLoader::checkAndLoad($filename);
        }
    }
297207
public function imageInfo($fileName)
    {
        if ($fileName instanceof ImageInterface) {
            return $fileName;
        }

        $image = $this->filesystem->getFile('files://' . $fileName, new NullableImage());

        return $image;
    }