package pl.vgtworld.imagedraw.processing;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import pl.vgtworld.imagedraw.Image;
import pl.vgtworld.imagedraw.ImageType;

public class ImageProcessing {
	
	private Image image;
	
	private ImageTypeMapper imageTypeMapper = new ImageTypeMapper();
	
	private ImageOpenActions openActions = new ImageOpenActions(imageTypeMapper);
	
	private ImageSaveActions saveActions = new ImageSaveActions(imageTypeMapper);
	
	public Image getImage() {
		return image;
	}
	
	public void open(String path) throws IOException {
		image = openActions.open(new File(path));
	}
	
	public void open(File file) throws IOException {
		image = openActions.open(file);
	}
	
	public void open(InputStream stream) throws IOException {
		image = openActions.open(stream);
	}
	
	public Image open(InputStream stream, ImageType imageType) throws IOException {
		return openActions.open(stream, imageType);
	}
	
	public void save(String path) throws IOException {
		saveActions.save(image, new File(path));
	}
	
	public void save(File file) throws IOException {
		saveActions.save(image, file);
	}
	
}

@@ -478,16 +478,88 @@
 per);%0A%09%0A
+%09private ImageResizeActions resizeActions = new ImageResizeActions();%0A%09%0A
 %09public 
@@ -1208,10 +1208,126 @@
 );%0A%09%7D%0A%09%0A
+%09public void resize(Integer newWidth, Integer newHeight) %7B%0A%09%09resizeActions.resize(image, newWidth, newHeight);%0A%09%7D%0A%09%0A
 %7D%0A

Add resize method in ImageProcessing class.