protected function getResizedFilename( $filepath, $width, $height, $crop ) {
		$filename = basename( $filepath );

		// match filename extension with dot
		// only the last extension will match when there are multiple ones
		$extension_pattern = '/(\.[^\.]+)$/';

		// add width, height and crop to filename
		$replacement = '-' . $width . 'x' . $height . ( $crop ? '-cropped' : '' ) . '$1';

		return preg_replace( $extension_pattern, $replacement, $filename );
	}
protected function getResizedFilename( $filepath, $width, $height, $crop ) {
		$filename = basename( $filepath );

		// match filename extension with dot
		// only the last extension will match when there are multiple ones
		$extension_pattern = '/(\.[^\.]+)$/';

		// add width, height and crop to filename
		$replacement = '-' . $width . 'x' . $height . ( $crop ? '-cropped' : '' ) . '$1';

		return preg_replace( $extension_pattern, $replacement, $filename );
	}
protected function getResizedFilename ( $ filepath , $ width , $ height , $ crop ) { $ filename = basename ( $ filepath ) ; // match filename extension with dot // only the last extension will match when there are multiple ones $ extension_pattern = '/(\.[^\.]+)$/' ; // add width, height and crop to filename $ replacement = '-' . $ width . 'x' . $ height . ( $ crop ? '-cropped' : '' ) . '$1' ; return preg_replace ( $ extension_pattern , $ replacement , $ filename ) ; }
Get a suitable name for a resized version of an image file.

@param  string  $filepath
@param  integer $width
@param  integer $height
@param  boolean $crop
@return string
Get a suitable name for a resized version of an image file .