lib/ImageHelper.php
static function delete_generated_files( $local_file ) {
		if ( URLHelper::is_absolute($local_file) ) {
			$local_file = URLHelper::url_to_file_system($local_file);
		}
		$info = pathinfo($local_file);
		$dir = $info['dirname'];
		$ext = $info['extension'];
		$filename = $info['filename'];
		self::process_delete_generated_files($filename, $ext, $dir, '-[0-9999999]*', '-[0-9]*x[0-9]*-c-[a-z]*.');
		self::process_delete_generated_files($filename, $ext, $dir, '-lbox-[0-9999999]*', '-lbox-[0-9]*x[0-9]*-[a-zA-Z0-9]*.');
		self::process_delete_generated_files($filename, 'jpg', $dir, '-tojpg.*');
		self::process_delete_generated_files($filename, 'jpg', $dir, '-tojpg-[0-9999999]*');
	}
static function delete_generated_files( $local_file ) {
		if ( URLHelper::is_absolute($local_file) ) {
			$local_file = URLHelper::url_to_file_system($local_file);
		}
		$info = pathinfo($local_file);
		$dir = $info['dirname'];
		$ext = $info['extension'];
		$filename = $info['filename'];
		self::process_delete_generated_files($filename, $ext, $dir, '-[0-9999999]*', '-[0-9]*x[0-9]*-c-[a-z]*.');
		self::process_delete_generated_files($filename, $ext, $dir, '-lbox-[0-9999999]*', '-lbox-[0-9]*x[0-9]*-[a-zA-Z0-9]*.');
		self::process_delete_generated_files($filename, 'jpg', $dir, '-tojpg.*');
		self::process_delete_generated_files($filename, 'jpg', $dir, '-tojpg-[0-9999999]*');
	}
static function delete_generated_files ( $ local_file ) { if ( URLHelper :: is_absolute ( $ local_file ) ) { $ local_file = URLHelper :: url_to_file_system ( $ local_file ) ; } $ info = pathinfo ( $ local_file ) ; $ dir = $ info [ 'dirname' ] ; $ ext = $ info [ 'extension' ] ; $ filename = $ info [ 'filename' ] ; self :: process_delete_generated_files ( $ filename , $ ext , $ dir , '-[0-9999999]*' , '-[0-9]*x[0-9]*-c-[a-z]*.' ) ; self :: process_delete_generated_files ( $ filename , $ ext , $ dir , '-lbox-[0-9999999]*' , '-lbox-[0-9]*x[0-9]*-[a-zA-Z0-9]*.' ) ; self :: process_delete_generated_files ( $ filename , 'jpg' , $ dir , '-tojpg.*' ) ; self :: process_delete_generated_files ( $ filename , 'jpg' , $ dir , '-tojpg-[0-9999999]*' ) ; }
Deletes the auto-generated files for resize and letterboxing created by Timber
@param string  $local_file   ex: /var/www/wp-content/uploads/2015/my-pic.jpg
or: http://example.org/wp-content/uploads/2015/my-pic.jpg
Deletes the auto - generated files for resize and letterboxing created by Timber