protected function recreateImageSizes(Image $file)
	{
		if ( ! $file instanceof Image) {
			throw new Exception\RuntimeException('Image entity expected');
		}

		$sizes = $file->getImageSizeCollection();
		if ( ! $sizes->isEmpty()) {
			foreach ($sizes as $size) {
				$sizeName = $size->getName();
				$filePath = $this->getImagePath($file, $sizeName);

				if (file_exists($filePath)) {
					
					$result = unlink($filePath);

					if ( ! $result) {
						throw new Exception\RuntimeException("Could not delete '$filePath' from file storage");
					}
				}

				$this->createResizedImage($file, $size->getTargetWidth(), $size->getTargetHeight(), $size->getCropMode(), $size->getQuality(), true);
			}
		}
	}
protected function recreateImageSizes(Image $file)
	{
		if ( ! $file instanceof Image) {
			throw new Exception\RuntimeException('Image entity expected');
		}

		$sizes = $file->getImageSizeCollection();
		if ( ! $sizes->isEmpty()) {
			foreach ($sizes as $size) {
				$sizeName = $size->getName();
				$filePath = $this->getImagePath($file, $sizeName);

				if (file_exists($filePath)) {
					
					$result = unlink($filePath);

					if ( ! $result) {
						throw new Exception\RuntimeException("Could not delete '$filePath' from file storage");
					}
				}

				$this->createResizedImage($file, $size->getTargetWidth(), $size->getTargetHeight(), $size->getCropMode(), $size->getQuality(), true);
			}
		}
	}
protected function recreateImageSizes ( Image $ file ) { if ( ! $ file instanceof Image ) { throw new Exception \ RuntimeException ( 'Image entity expected' ) ; } $ sizes = $ file -> getImageSizeCollection ( ) ; if ( ! $ sizes -> isEmpty ( ) ) { foreach ( $ sizes as $ size ) { $ sizeName = $ size -> getName ( ) ; $ filePath = $ this -> getImagePath ( $ file , $ sizeName ) ; if ( file_exists ( $ filePath ) ) { $ result = unlink ( $ filePath ) ; if ( ! $ result ) { throw new Exception \ RuntimeException ( "Could not delete '$filePath' from file storage" ) ; } } $ this -> createResizedImage ( $ file , $ size -> getTargetWidth ( ) , $ size -> getTargetHeight ( ) , $ size -> getCropMode ( ) , $ size -> getQuality ( ) , true ) ; } } }
Recreate all existing resized versions of the image
@param Image $file
Recreate all existing resized versions of the image