package org.wikiwebserver.util.image;

import java.io.OutputStream;


public class GraphicsHelperFactory {
    
    public static GraphicsHelper create(String contentType, int width, int height, OutputStream out) {
        
        if (contentType.equals("image/jpeg") || contentType.equals("image/jpg")) {
            return new ImageIOHelper(width, height, "jpeg", out);
        }
        if (contentType.equals("image/png")) {
            return new ImageIOHelper(width, height, "png", out);     
        }
        if (contentType.equals("image/svg+xml")) {
            return new SVGHelper(width, height, out);
        }
        if (contentType.equals("application/pdf")) {
            return new PDFHelper(width, height, out);
        }
        
        return new ImageIOHelper(width, height, "gif", out);                  
    }
    
}

