Return null image in resizeImage if image is null
This commit is contained in:
@@ -16,6 +16,8 @@ class ImageHelper {
|
|||||||
public static function rasterizeSVG (path:String, width:Int, height:Int, backgroundColor:Int = null):Image {
|
public static function rasterizeSVG (path:String, width:Int, height:Int, backgroundColor:Int = null):Image {
|
||||||
//public static function rasterizeSVG (svg:Dynamic /*SVG*/, width:Int, height:Int, backgroundColor:Int = null):Image {
|
//public static function rasterizeSVG (svg:Dynamic /*SVG*/, width:Int, height:Int, backgroundColor:Int = null):Image {
|
||||||
|
|
||||||
|
if (path == null) return null;
|
||||||
|
|
||||||
var temp = PathHelper.getTemporaryFile (".png");
|
var temp = PathHelper.getTemporaryFile (".png");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -124,6 +126,8 @@ class ImageHelper {
|
|||||||
|
|
||||||
public static function resizeImage (image:Image, width:Int, height:Int):Image {
|
public static function resizeImage (image:Image, width:Int, height:Int):Image {
|
||||||
|
|
||||||
|
if (image == null) return null;
|
||||||
|
|
||||||
if (image.width == width && image.height == height) {
|
if (image.width == width && image.height == height) {
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
|
|||||||
Reference in New Issue
Block a user