@@ -340,9 +340,7 @@ module('FileAPI');
340
340
checkFile ( _files [ 'dino.png' ] , 'dino.png' , 'image/png' , 461003 ) ;
341
341
checkFile ( _files [ 'hello.txt' ] , 'hello.txt' , 'text/plain' , 15 ) ;
342
342
checkFile ( _files [ 'image.jpg' ] , 'image.jpg' , 'image/jpeg' , 108338 ) ;
343
-
344
- // @todo : Сейчас через phantom "application/octet-stream"
345
- // checkFile(_files['lebowski.json'], 'lebowski.json', 'application/json', 5392);
343
+ // checkFile(_files['lebowski.json'], 'lebowski.json', 'application/json', 5392);
346
344
}
347
345
} ) ;
348
346
} ) ;
@@ -392,6 +390,38 @@ module('FileAPI');
392
390
} ) ;
393
391
394
392
393
+ test ( 'upload + autoOrientation' , function ( ) {
394
+ var queue = FileAPI . queue ( start ) ;
395
+
396
+ stop ( ) ;
397
+ queue . inc ( ) ;
398
+ queue . inc ( ) ;
399
+
400
+ FileAPI . upload ( {
401
+ url : 'http://rubaxa.org/FileAPI/server/ctrl.php' ,
402
+ files : { image : FileAPI . getFiles ( uploadForm [ 'image.jpg' ] ) [ 0 ] } ,
403
+ imageAutoOrientation : true ,
404
+ complete : function ( err , res ) {
405
+ var res = FileAPI . parseJSON ( res . responseText ) ;
406
+ equal ( res . images . image . width , 448 , 'imageAutoOrientation.width' ) ;
407
+ equal ( res . images . image . height , 632 , 'imageAutoOrientation.height' ) ;
408
+ queue . next ( ) ;
409
+ }
410
+ } ) ;
411
+
412
+ FileAPI . upload ( {
413
+ url : 'http://rubaxa.org/FileAPI/server/ctrl.php' ,
414
+ files : { image : FileAPI . getFiles ( uploadForm [ 'image.jpg' ] ) [ 0 ] } ,
415
+ imageTransform : { rotate : 'auto' } ,
416
+ complete : function ( err , res ) {
417
+ var res = FileAPI . parseJSON ( res . responseText ) ;
418
+ equal ( res . images . image . width , 448 , 'imageTransform.rotate.auto.width' ) ;
419
+ equal ( res . images . image . height , 632 , 'imageTransform.rotate.auto.height' ) ;
420
+ queue . next ( ) ;
421
+ }
422
+ } ) ;
423
+ } ) ;
424
+
395
425
396
426
FileAPI . html5 && test ( 'upload + multi imageTransform' , function ( ) {
397
427
var file = FileAPI . getFiles ( uploadForm [ 'dino.png' ] ) [ 0 ] ;
0 commit comments