@@ -22,8 +22,8 @@ package ru.mail.commands
2222 *
2323 * file must be loaded before transforming.
2424 *
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
2727 *
2828 * The possible solution is to transform them but save as PNG, but we also have to change the uploaded file extension to png.
2929 *
@@ -47,18 +47,16 @@ package ru.mail.commands
4747{
4848if ( ! file . imageData ) {
4949complete(false , null , new ErrorVO("ResizeImageCommand - cannot resize file because it has not been succesfully loaded" ) );
50+ return ;
5051}
5152
5253if (! needResize()) {
5354LoggerJS. log ('ResizeImageCommand no need to resize' );
5455complete(true , file . fileData);
56+ return ;
5557}
5658
5759var fileType: String = file . fileType;
58- if (fileType == "gif" || fileType == "bmp" ) {
59- // TODO: scale but save jpg
60- complete(true , file . fileData)
61- }
6260
6361checkTransform();
6462
@@ -143,15 +141,12 @@ package ru.mail.commands
143141
144142if (imageTransform. multiPassResize && maxScale < 0.5 ) {
145143
146- trace ("multi-step " );
147-
148144var curWidth: Number = currentImageMap. width ;
149145var curHeight: Number = currentImageMap. height ;
150146var mapToScale: BitmapData ;
151147// multi-step
152148while (maxScale < 0.5 )
153149{
154- trace ("step " , maxScale);
155150// series if x2 scalings
156151
157152// temp bitmapdata
0 commit comments