M.plugin('drawing').create(function(status, result) {
	if( status == 'SUCCESS') {
		// result : 편집된 이미지 경로 및 이미지 위치 정보를 저장한 객체                 
		// result.path : 결과 이미지경로 스트링                              
		// result.savePoint : 이미지 저장 위치 "APPINSIDE" or "APPOUTSIDE"
		// TODO : code here

		M.tool.log( status, result );
		alert( JSON.stringify( result ) );

		var img = document.createElement("IMG");
		img.src = result.path;

		$("#drawing-output-1").append( $(img) );
	}
	else {
		// TODO : code here

		alert( "FAIL");
	}
});

M.media.library({
	media: "PHOTO",
	choose: "SINGLE"
}, function( status, result ) {
	
	if ( status == "SUCCESS" ) {
		var option = { path:result.path };

		M.plugin('drawing').create(function(status, result) {
			if( status == 'SUCCESS') {
				// result : 편집된 이미지 경로 및 이미지 위치 정보를 저장한 객체                 
				// result.path : 결과 이미지경로 스트링                              
				// result.savePoint : 이미지 저장 위치 "APPINSIDE" or "APPOUTSIDE"
				// TODO : code here

				M.tool.log( status, result );
				alert( JSON.stringify( result ) );

				var img = document.createElement("IMG");
				img.src = result.path;

				$("#drawing-output-2").append( $(img) );
			}
			else {
				// TODO : code here

				alert( "FAIL");
			}
		}, option );
	}

});