1- import image = require( "image/image" ) ;
1+ import imageSource = require( "image-source /image-source " ) ;
22import app = require( "application/application" ) ;
33import fs = require( "file-system/file-system" ) ;
44import TKUnit = require( "Tests/TKUnit" ) ;
55
66export var testFromResource = function ( ) {
7- var img = image . fromResource ( getTestImageName ( ) ) ;
7+ var img = imageSource . fromResource ( getTestImageName ( ) ) ;
88 TKUnit . assert ( img . height > 0 , "image.fromResource failed" ) ;
99}
1010
1111export var testFromUrl = function ( ) {
1212 var completed ;
13- var result : image . Image ;
13+ var result : imageSource . ImageSource ;
1414
15- image . fromUrl ( "http://www.google.com/images/errors/logo_sm_2.png" )
16- . then ( function ( res : image . Image ) {
15+ imageSource . fromUrl ( "http://www.google.com/images/errors/logo_sm_2.png" )
16+ . then ( function ( res : imageSource . ImageSource ) {
1717 completed = true ;
1818 result = res ;
1919 } )
@@ -31,11 +31,11 @@ export var testFromUrl = function () {
3131}
3232
3333export var testSaveToFile = function ( ) {
34- var img = image . fromResource ( getTestImageName ( ) ) ;
34+ var img = imageSource . fromResource ( getTestImageName ( ) ) ;
3535 var folder = fs . knownFolders . documents ( ) ;
3636 var path = fs . path . join ( folder . path , "Test.png" ) ;
3737
38- var saved = img . saveToFile ( path , image . ImageFormat . PNG ) ;
38+ var saved = img . saveToFile ( path , imageSource . ImageFormat . PNG ) ;
3939 TKUnit . assert ( saved , "Image not saved to file" ) ;
4040 TKUnit . assert ( fs . File . exists ( path ) , "Image not saved to file" ) ;
4141}
@@ -44,7 +44,7 @@ export var testFromFile = function () {
4444 var folder = fs . knownFolders . documents ( ) ;
4545 var path = fs . path . join ( folder . path , "Test.png" ) ;
4646
47- var img = image . fromFile ( path ) ;
47+ var img = imageSource . fromFile ( path ) ;
4848
4949 TKUnit . assert ( img . height > 0 , "image.fromResource failed" ) ;
5050
@@ -55,7 +55,7 @@ export var testFromFile = function () {
5555}
5656
5757export var testNativeFields = function ( ) {
58- var img = image . fromResource ( getTestImageName ( ) ) ;
58+ var img = imageSource . fromResource ( getTestImageName ( ) ) ;
5959 if ( app . android ) {
6060 TKUnit . assert ( img . android != null , "Image.android not updated." ) ;
6161 } else if ( app . ios ) {
0 commit comments