001 package railo.runtime.functions.image; 002 003 004 import java.io.IOException; 005 006 import railo.runtime.PageContext; 007 import railo.runtime.exp.PageException; 008 import railo.runtime.ext.function.Function; 009 import railo.runtime.img.Image; 010 import railo.runtime.op.Caster; 011 012 public class ImageReadBase64 implements Function { 013 014 public static Object call(PageContext pc, String source) throws PageException { 015 try { 016 return new Image(source); 017 } catch (IOException e) { 018 throw Caster.toPageException(e); 019 } 020 } 021 }