Patch image.encode

This commit is contained in:
Joshua Granick
2015-07-24 20:18:19 -07:00
parent 61ea90d647
commit efc92cffc0
3 changed files with 30 additions and 0 deletions

View File

@@ -11,6 +11,16 @@ class BMP {
public static function encode (image:Image, type:BMPType = null):ByteArray {
if (image.premultiplied || image.format != RGBA32) {
// TODO: Handle encode from different formats
image = image.clone ();
image.premultiplied = false;
image.format = RGBA32;
}
if (type == null) {
type = RGB;

View File

@@ -55,6 +55,16 @@ class JPEG {
public static function encode (image:Image, quality:Int):ByteArray {
if (image.premultiplied || image.format != RGBA32) {
// TODO: Handle encode from different formats
image = image.clone ();
image.premultiplied = false;
image.format = RGBA32;
}
#if java
#elseif (sys && (!disable_cffi || !format))

View File

@@ -62,6 +62,16 @@ class PNG {
public static function encode (image:Image):ByteArray {
if (image.premultiplied || image.format != RGBA32) {
// TODO: Handle encode from different formats
image = image.clone ();
image.premultiplied = false;
image.format = RGBA32;
}
#if java
#elseif (sys && (!disable_cffi || !format))