@@ -22,8 +22,8 @@ package ru.mail.commands
22
22
*
23
23
* file must be loaded before transforming.
24
24
*
25
- * Only JPG or PNG images.
26
- * Performing transform on gif or bmp will result in returning the original image data.
25
+ * JPG and PNG will keep their extensions after transform.
26
+ * GIF and BMP will be encoded as PNG, so uploaded filename will be .png
27
27
*
28
28
* The possible solution is to transform them but save as PNG, but we also have to change the uploaded file extension to png.
29
29
*
@@ -47,18 +47,16 @@ package ru.mail.commands
47
47
{
48
48
if ( ! file . imageData ) {
49
49
complete(false , null , new ErrorVO("ResizeImageCommand - cannot resize file because it has not been succesfully loaded" ) );
50
+ return ;
50
51
}
51
52
52
53
if (! needResize()) {
53
54
LoggerJS. log ('ResizeImageCommand no need to resize' );
54
55
complete(true , file . fileData);
56
+ return ;
55
57
}
56
58
57
59
var fileType: String = file . fileType;
58
- if (fileType == "gif" || fileType == "bmp" ) {
59
- // TODO: scale but save jpg
60
- complete(true , file . fileData)
61
- }
62
60
63
61
checkTransform();
64
62
@@ -143,15 +141,12 @@ package ru.mail.commands
143
141
144
142
if (imageTransform. multiPassResize && maxScale < 0.5 ) {
145
143
146
- trace ("multi-step " );
147
-
148
144
var curWidth: Number = currentImageMap. width ;
149
145
var curHeight: Number = currentImageMap. height ;
150
146
var mapToScale: BitmapData ;
151
147
// multi-step
152
148
while (maxScale < 0.5 )
153
149
{
154
- trace ("step " , maxScale);
155
150
// series if x2 scalings
156
151
157
152
// temp bitmapdata
0 commit comments