Patch image.encode
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user