diff --git a/src/imagepicker.android.ts b/src/imagepicker.android.ts index 03bd969..770f391 100644 --- a/src/imagepicker.android.ts +++ b/src/imagepicker.android.ts @@ -18,8 +18,6 @@ let StaticArrayBuffer = ArrayBuffer; export class SelectedAsset extends imageAssetModule.ImageAsset { private _uri: android.net.Uri; - private _thumb: imagesource.ImageSource; - private _thumbRequested: boolean; private _thumbAsset: imageAssetModule.ImageAsset; private _fileUri: string; private _data: ArrayBuffer; @@ -27,7 +25,6 @@ export class SelectedAsset extends imageAssetModule.ImageAsset { constructor(uri: android.net.Uri) { super(SelectedAsset._calculateFileUri(uri)); this._uri = uri; - this._thumbRequested = false; } data(): Promise { @@ -58,14 +55,6 @@ export class SelectedAsset extends imageAssetModule.ImageAsset { }); } - // [Deprecated. Please use thumbAsset instead.] - get thumb(): imagesource.ImageSource { - if (!this._thumbRequested) { - this.decodeThumbUri(); - } - return this._thumb; - } - get thumbAsset(): imageAssetModule.ImageAsset { return this._thumbAsset; } @@ -188,18 +177,6 @@ export class SelectedAsset extends imageAssetModule.ImageAsset { return "com.android.providers.media.documents" === uri.getAuthority(); } - private decodeThumbUri(): void { - // Decode image size - let REQUIRED_SIZE = { - maxWidth: 100, - maxHeight: 100 - }; - - // Decode with scale - this._thumb = this.decodeUri(this._uri, REQUIRED_SIZE); - this.notifyPropertyChange("thumb", this._thumb); - } - private decodeThumbAssetUri(): void { // Decode image size let REQUIRED_SIZE = { diff --git a/src/imagepicker.ios.ts b/src/imagepicker.ios.ts index ad30719..5687e60 100644 --- a/src/imagepicker.ios.ts +++ b/src/imagepicker.ios.ts @@ -117,7 +117,6 @@ export class Album extends data_observable.Observable { private _imagePicker: ImagePicker; private _assets: data_observablearray.ObservableArray; private _title: string; - private _thumb: image_source.ImageSource; private _thumbAsset: imageAssetModule.ImageAsset; constructor(imagePicker: ImagePicker, title: string) { @@ -139,16 +138,6 @@ export class Album extends data_observable.Observable { return this._assets; } - // [Deprecated. Please use thumbAsset instead.] - get thumb(): image_source.ImageSource { - return this._thumb; - } - - protected setThumb(value: image_source.ImageSource): void { - this._thumb = value; - this.notifyPropertyChange("thumb", value); - } - get thumbAsset(): imageAssetModule.ImageAsset { return this._thumbAsset; } @@ -160,11 +149,6 @@ export class Album extends data_observable.Observable { } export class SelectedAsset extends imageAssetModule.ImageAsset { - // [Deprecated. SelectedAsset will be used directly as a source for the thumb image] - get thumb(): image_source.ImageSource { - return null; - } - get uri(): string { return null; } @@ -186,9 +170,7 @@ export class Asset extends SelectedAsset { private _selected: boolean; private _album: Album; - private _thumb: image_source.ImageSource; private _image: image_source.ImageSource; - private _thumbRequested: boolean; constructor(album: Album, asset: PHAsset | UIImage) { super(asset); @@ -200,15 +182,6 @@ export class Asset extends SelectedAsset { return this._album; } - // [Deprecated. Asset will be used directly as a source for the thumb image] - get thumb(): image_source.ImageSource { - if (!this._thumbRequested) { - this._thumbRequested = true; - this.onThumbRequest(); - } - return this._thumb; - } - get selected(): boolean { return !!this._selected; } @@ -243,14 +216,6 @@ export class Asset extends SelectedAsset { data(): Promise { return Promise.reject(new Error("Not implemented.")); } - - protected setThumb(value: image_source.ImageSource): void { - this._thumb = value; - this.notifyPropertyChange("thumb", this._thumb); - } - - protected onThumbRequest(): void { - } } // iOS8+ Photo framework based view model implementation... @@ -314,15 +279,6 @@ class ImagePickerPH extends ImagePicker { } } - createPHImageThumb(target, asset: PHAsset): void { - PHImageManager.defaultManager().requestImageForAssetTargetSizeContentModeOptionsResultHandler(asset, this._thumbRequestSize, PHImageContentMode.AspectFill, - this._thumbRequestOptions, function (target, uiImage, info) { - let imageSource = new image_source.ImageSource(); - imageSource.setNativeSource(uiImage); - target.setThumb(imageSource); - }.bind(this, target)); - } - createPHImageThumbAsset(target, asset: PHAsset): void { PHImageManager.defaultManager().requestImageForAssetTargetSizeContentModeOptionsResultHandler(asset, this._thumbRequestSize, PHImageContentMode.AspectFill, this._thumbRequestOptions, function (target, uiImage, info) { @@ -427,7 +383,6 @@ class AlbumPH extends Album { if (!this._setThumb && imagePicker) { this._setThumb = true; - imagePicker.createPHImageThumb(this, asset); imagePicker.createPHImageThumbAsset(this, asset); } @@ -456,11 +411,6 @@ class AssetPH extends Asset { return this._phAsset; } - protected onThumbRequest(): void { - super.onThumbRequest(); - ((this.album).imagePicker).createPHImageThumb(this, this._phAsset); - } - get uri(): string { return this._phAsset.localIdentifier.toString(); } diff --git a/src/index.d.ts b/src/index.d.ts index 0c173a7..e2930c6 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -20,13 +20,6 @@ export interface ImageOptions { } export class SelectedAsset extends imageAssetModule.ImageAsset { - /** - * [Deprecated. SelectedAsset will be used directly as a source for the thumb image] - * A 100x100 pixels thumb of the selected image. - * This property will be initialized on demand. The first access will return undefined or null. - * It will trigger an async load and when the thumb is obtained, a property changed notification will occur. - */ - thumb: imagesource.ImageSource; /** * URI that identifies the image asset.