Socket
Socket
Sign inDemoInstall

nativescript-imagepicker

Package Overview
Dependencies
Maintainers
9
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-imagepicker - npm Package Compare versions

Comparing version 4.0.1 to 5.0.0

0

albums.ios.js

@@ -0,0 +0,0 @@ "use strict";

32

imagepicker.android.js

@@ -7,8 +7,2 @@ "use strict";

var permissions = require("nativescript-permissions");
var Intent = android.content.Intent;
var Activity = android.app.Activity;
var MediaStore = android.provider.MediaStore;
var DocumentsContract = android.provider.DocumentsContract;
var BitmapFactory = android.graphics.BitmapFactory;
var StaticArrayBuffer = ArrayBuffer;
var SelectedAsset = (function (_super) {

@@ -41,3 +35,3 @@ __extends(SelectedAsset, _super);

var bb = _this.getByteBuffer(_this._uri);
_this._data = StaticArrayBuffer.from(bb);
_this._data = ArrayBuffer.from(bb);
}

@@ -80,2 +74,3 @@ resolve(_this._data);

SelectedAsset._calculateFileUri = function (uri) {
var DocumentsContract = android.provider.DocumentsContract;
var isKitKat = android.os.Build.VERSION.SDK_INT >= 19;

@@ -104,9 +99,9 @@ if (isKitKat && DocumentsContract.isDocumentUri(application.android.context, uri)) {

if ("image" === type) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
contentUri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
}
else if ("video" === type) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
contentUri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
}
else if ("audio" === type) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
contentUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}

@@ -130,3 +125,3 @@ var selection = "_id=?";

var cursor = null;
var columns = [MediaStore.MediaColumns.DATA];
var columns = [android.provider.MediaStore.MediaColumns.DATA];
var filePath;

@@ -171,5 +166,5 @@ try {

SelectedAsset.prototype.getSampleSize = function (uri, options) {
var boundsOptions = new BitmapFactory.Options();
var boundsOptions = new android.graphics.BitmapFactory.Options();
boundsOptions.inJustDecodeBounds = true;
BitmapFactory.decodeStream(this.openInputStream(uri), null, boundsOptions);
android.graphics.BitmapFactory.decodeStream(this.openInputStream(uri), null, boundsOptions);
var outWidth = boundsOptions.outWidth;

@@ -197,5 +192,5 @@ var outHeight = boundsOptions.outHeight;

SelectedAsset.prototype.decodeUri = function (uri, options) {
var downsampleOptions = new BitmapFactory.Options();
var downsampleOptions = new android.graphics.BitmapFactory.Options();
downsampleOptions.inSampleSize = this.getSampleSize(uri, options);
var bitmap = BitmapFactory.decodeStream(this.openInputStream(uri), null, downsampleOptions);
var bitmap = android.graphics.BitmapFactory.decodeStream(this.openInputStream(uri), null, downsampleOptions);
var image = new imagesource.ImageSource();

@@ -206,5 +201,5 @@ image.setNativeSource(bitmap);

SelectedAsset.prototype.decodeUriForImageAsset = function (uri, options) {
var downsampleOptions = new BitmapFactory.Options();
var downsampleOptions = new android.graphics.BitmapFactory.Options();
downsampleOptions.inSampleSize = this.getSampleSize(uri, options);
var bitmap = BitmapFactory.decodeStream(this.openInputStream(uri), null, downsampleOptions);
var bitmap = android.graphics.BitmapFactory.decodeStream(this.openInputStream(uri), null, downsampleOptions);
return new imageAssetModule.ImageAsset(bitmap);

@@ -269,3 +264,3 @@ };

if (requestCode === RESULT_CODE_PICKER_IMAGES) {
if (resultCode === Activity.RESULT_OK) {
if (resultCode === android.app.Activity.RESULT_OK) {
try {

@@ -307,2 +302,3 @@ var results = [];

}
var Intent = android.content.Intent;
var intent = new Intent();

@@ -309,0 +305,0 @@ intent.setType("image/*");

@@ -19,5 +19,3 @@ "use strict";

function create(options) {
if (true) {
return new ImagePickerPH(options);
}
return new ImagePickerPH(options);
}

@@ -24,0 +22,0 @@ exports.create = create;

@@ -8,3 +8,3 @@ "use strict";

var action_bar_1 = require("tns-core-modules/ui/action-bar");
var listview_1 = require("nativescript-pro-ui/listview");
var nativescript_ui_listview_1 = require("nativescript-ui-listview");
var page;

@@ -49,6 +49,6 @@ var list;

page.actionBar = actionBar;
var listView = new listview_1.RadListView();
var listView = new nativescript_ui_listview_1.RadListView();
listView.id = "images-list";
listView.bind({ targetProperty: "items", sourceProperty: "assets", twoWay: false });
var listViewGridLayout = new listview_1.ListViewGridLayout();
var listViewGridLayout = new nativescript_ui_listview_1.ListViewGridLayout();
listViewGridLayout.scrollDirection = "Vertical";

@@ -55,0 +55,0 @@ listViewGridLayout.spanCount = 4;

@@ -72,3 +72,3 @@ import { Observable } from "tns-core-modules/data/observable";

* Present the image picker UI.
* The result will be an array of SelectedAsset instances provided when the promise is fulfiled.
* The result will be an array of SelectedAsset instances provided when the promise is fulfilled.
*/

@@ -75,0 +75,0 @@ present(): Promise<SelectedAsset[]>;

{
"name": "nativescript-imagepicker",
"version": "4.0.1",
"version": "5.0.0",
"description": "A plugin for the NativeScript framework implementing multiple image picker",

@@ -19,3 +19,3 @@ "repository": {

"ngc": "node --max-old-space-size=8192 ./node_modules/.bin/ngc",
"build": "npm i && tsc",
"build": "npm i && tsc",
"prepublishOnly": "npm run build",

@@ -32,2 +32,4 @@ "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",

"demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles",
"demo.ng.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios --syncAllFiles",
"demo.ng.android": "npm i && npm run tsc && cd ../demo-angular && tns run android --syncAllFiles",
"clean": "rm -rf node_modules && cd ../demo && rm -rf hooks node_modules platforms && cd ../src && npm run plugin.link"

@@ -50,8 +52,9 @@ },

"tns-core-modules": "^3.1.0",
"tns-platform-declarations": "^3.0.0",
"typescript": "~2.3.0",
"tns-platform-declarations": "^3.1.0",
"typescript": "~2.6.0",
"tslint": "~5.4.3"
},
"dependencies": {
"nativescript-pro-ui": "^3.1.2",
"nativescript-ui-core": "^1.0.0",
"nativescript-ui-listview": "^3.5.0",
"nativescript-permissions": "~1.2.3"

@@ -58,0 +61,0 @@ },

@@ -12,2 +12,22 @@ # NativeScript Image Picker ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png)

<!-- TOC depthFrom:2 -->
- [Installation](#installation)
- [Configuration](#configuration)
- [Migrating from 4.x.x to 5.x.x](#migrating-from-4xx-to-5xx)
- [Migrating from 3.x.x to 4.x.x](#migrating-from-3xx-to-4xx)
- [Usage](#usage)
- [Import the plugin](#import-the-plugin)
- [Create imagepicker](#create-imagepicker)
- [Request permissions, show the images list and process the selection](#request-permissions-show-the-images-list-and-process-the-selection)
- [API](#api)
- [Methods](#methods)
- [Properties](#properties)
- [Image properties](#image-properties)
- [Contribute](#contribute)
- [Get Help](#get-help)
<!-- /TOC -->
## Installation

@@ -19,4 +39,16 @@

tns plugin add nativescript-imagepicker
tns run
```
## Configuration
No additional configuration required!
## Migrating from 4.x.x to 5.x.x
With version **5.x.x** major update to the plugin there is a related dependency which needs to be updated inside your project. The plugin uses internally the `nativescript-ui-listview` plugin (part of the NativeScript Pro UI components). Recently the monolithic [NativeScript Pro UI plugin was split in multiple plugins](https://www.nativescript.org/blog/professional-components-from-nativescript-ui-the-big-breakup), each of them representing a single component. Now, instead of the monolithic package, nativescript-imagepicker uses only the component it needs. To use version 5.x.x of the plugin, you need to update any dependencies to `nativescript-pro-ui` in your project with the single component alternatives as described in the [migration guide](http://docs.telerik.com/devtools/nativescript-ui/migration).
## Migrating from 3.x.x to 4.x.x
With the **4.x.x** major update to the plugin there is a related dependency which needs to be updated inside your project. The plugin uses internally the `nativescript-pro-ui` plugin (previously known as `nativescript-telerik-ui`) which has bee updated and made 100% free. This means that if your project is using the deprecated `nativescript-telerik-ui`/`pro` plugins adding the latest version of the `nativescript-imagepicker` plugin will cause your project to throw an build error when working with iOS. This is because the `nativescript-imagepicker` has a dependency to the new `nativescript-pro-ui` plugin and when your project also depends on the old `nativescript-telerik-ui` plugin there is a native frameworks collision.
In order to solve this you simply have to update to the latest `nativescript-pro-ui`, more details on how to migrate from `nativescript-telerik-ui`/`pro` to `nativescript-pro-ui` can be found [here](http://docs.telerik.com/devtools/nativescript-ui/migration).
## Usage

@@ -94,3 +126,3 @@

* authorize() - request iOS specific permissions.
* authorize() - request the required permissions.
* present() - show the albums to present the user the ability to select images. Returns an array of the selected images.

@@ -118,4 +150,9 @@ * cancel() - cancel selection. iOS only.

## License
## Contribute
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-imagepicker/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
2015, Telerik AD
## Get Help
Please, use [github issues](https://github.com/NativeScript/nativescript-imagepicker/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-imagepicker?pixel)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc