Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Chinese(Simplified) language #233

Open
wants to merge 73 commits into
base: permission-description
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
665f351
Made appearance closer to the stock Photos app.
Oct 29, 2014
623d445
fixed bug where some images got a white line on the right or bottom. …
shanebdavis Mar 10, 2015
a173570
updated readme with output type example
rabeyta May 18, 2015
ebb74d7
added OutputType to ImagePicker to hold output options
rabeyta May 18, 2015
2bc9516
added validation method for outputType. If there is an invalid value …
rabeyta May 18, 2015
ca844db
updated getPictures to validate the outputType and default it to FILE…
rabeyta May 18, 2015
6c86ffc
added outputType to SOSPicker header
rabeyta May 18, 2015
f15e0b6
created enum to hold outputType values inside SOSPicker
rabeyta May 18, 2015
8bd64c7
set outputType from passed in options
rabeyta May 18, 2015
80b4fc3
based on options for outputType, add base64 encoded string or file_ur…
rabeyta May 18, 2015
5e856c8
created enum to hold OutputType values
rabeyta May 18, 2015
647e284
store outputType in activity based on options passed in
rabeyta May 18, 2015
181e826
added method to getBase64 String from Bitmap
rabeyta May 18, 2015
b772953
added missed import for ByteArrayOutputStream
rabeyta May 18, 2015
0a62ad1
based on outputType option, add base64 string or file uri to output list
rabeyta May 18, 2015
3e5838e
added missing import for base64
rabeyta May 23, 2015
92a1b6b
added missing constant for outputTypeKey
rabeyta May 23, 2015
bfb7025
fixed outputType reference for logic for file or base64 output
rabeyta May 23, 2015
fd055c2
Updated ImagePicker to grab output type from options and pass to plug…
rabeyta May 23, 2015
4452872
Merge branch 'master' of https://github.com/shanebdavis/cordova-image…
EddyVerbruggen Jun 4, 2015
1735907
Merge branch 'improve-appearance' of https://github.com/JonathanAquin…
EddyVerbruggen Jun 4, 2015
959b379
#1 Cordova-Android 4 compatibility
EddyVerbruggen Jun 13, 2015
48711ae
Deleted the ELCImagePicker plugin
hanssens Aug 19, 2015
924651f
Added the GMImagePicker
hanssens Aug 19, 2015
42de0ff
Changed usage of ELC=>GM as dependency
hanssens Aug 19, 2015
2aab5cd
Android plugin now supports thumbnails as well
hanssens Aug 19, 2015
59668e6
Merge pull request #1 from hanssens/replace-elc-with-gm
hanssens Aug 19, 2015
a2ec5ca
Give new options/parameters a default value
hanssens Aug 20, 2015
54444b9
Updated references to GMImagePicker
hanssens Aug 20, 2015
b4cee77
#4 The name of my app on android is now ImagePicker
EddyVerbruggen Oct 28, 2015
ce33f74
Merge remote-tracking branch 'upstream/master'
EddyVerbruggen Oct 28, 2015
b88f710
#2 Support for iCloud photos on iOS
EddyVerbruggen Oct 29, 2015
3900d47
#2 Support for iCloud photos on iOS - modifications
EddyVerbruggen Oct 29, 2015
ecdb593
Implemented support for Cordova 5 Android permissions
simba909 Jan 4, 2016
f524bcc
Removed unused import from ImagePicker
simba909 Jan 7, 2016
1bd72e3
Cleaned up MultiImageChooserActivity
simba909 Jan 7, 2016
6480932
Moved to using AppCompatActivity and the support ActionBar, minor cle…
simba909 Jan 7, 2016
82cc0d6
(Android) Improved actionbar resource files
simba909 Jan 8, 2016
425b111
(Android) More small cleanup, allow cancel even if no image is selected
simba909 Jan 8, 2016
785985c
(Android) Added more translatable strings, added Swedish translation
simba909 Jan 8, 2016
ad94b31
Merge pull request #5 from simba909/master
EddyVerbruggen Jan 20, 2016
8407bca
#5 Implemented support for Cordova 5 Android permissions
EddyVerbruggen Jan 20, 2016
1344f1f
#5 Implemented support for Cordova 5 Android permissions
EddyVerbruggen Jan 21, 2016
350df5f
max images is for Android only since we upgraded the iOS framework to…
EddyVerbruggen Jan 21, 2016
fa08d34
Removed a few frameworks conflicting with AppBuilder LiveSync
EddyVerbruggen Jan 22, 2016
651f360
Implement iOS PHPhotoLibrary authentications
takeo-asai Jun 15, 2016
f1be2b1
Merge pull request #12 from takeo-asai/dev-ios-permissions
EddyVerbruggen Jun 15, 2016
620d139
bump
EddyVerbruggen Jun 15, 2016
3467c34
{Android} Fix width/height parameters
mickaelmagniez Jun 16, 2016
6f72efc
Merge pull request #14 from MickaelMagniez/master
EddyVerbruggen Jun 17, 2016
3bc75db
bump
EddyVerbruggen Jun 17, 2016
fe55db0
Fix localization
MBuchalik Jul 6, 2016
b18a3be
Fixed formatting
MBuchalik Jul 7, 2016
42db1a2
Merge pull request #16 from MBuchalik/master
EddyVerbruggen Jul 30, 2016
7b23195
Update plugin.xml
EddyVerbruggen Jul 30, 2016
6535539
Add option disable_popover
MBuchalik Jul 31, 2016
6cae630
Merge pull request #17 from MBuchalik/master
EddyVerbruggen Jul 31, 2016
d5dc79e
Fixed rotation issue during processing
Ronnnn Aug 3, 2016
3ab8552
Merge pull request #18 from Ronnnn/master
EddyVerbruggen Aug 8, 2016
efed3ad
Update plugin.xml
EddyVerbruggen Aug 9, 2016
e14a76b
Remove line ending for base64 encoding on iOS
sereysethy Dec 20, 2016
19450d8
Merge pull request #1 from sereysethy/base64-no-line-ending
sereysethy Dec 20, 2016
a3278ad
Merge pull request #30 from sereysethy/master
EddyVerbruggen Dec 20, 2016
290375d
bump
EddyVerbruggen Dec 26, 2016
589bb15
iOS 10 - Missing description
Dec 27, 2016
3618c28
add variable $PHOTO_LIBRARY_USAGE_DESCRIPTION
Dec 27, 2016
3931f21
change readme
Dec 27, 2016
8f12ca2
Merge pull request #31 from tkisme/patch-1
EddyVerbruggen Dec 27, 2016
b904b4c
Update plugin.xml
EddyVerbruggen Dec 27, 2016
2588413
use Base64.NO_WRAP
xueron Feb 20, 2017
1d45330
Merge pull request #38 from xueron/xueron-base64
EddyVerbruggen Feb 20, 2017
742fe42
add Chinese(Simplified) language
May 15, 2017
2c4c1d6
add Chinese(Simplified) language
go-mou May 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
xcuserdata/
project.xcworkspace/
tags
.idea
113 changes: 78 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ Cordova Plugin For Multiple Image Selection - implemented for iOS and Android 4.
The plugin conforms to the Cordova plugin specification, it can be installed
using the Cordova / Phonegap command line interface.

phonegap plugin add https://github.com/wymsee/cordova-imagePicker.git
# without desc
phonegap plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git
cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git

# with desc
phonegap plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"

cordova plugin add https://github.com/wymsee/cordova-imagePicker.git
cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"


## Using the plugin
Expand All @@ -20,54 +25,92 @@ The plugin creates the object `window.imagePicker` with the method `getPictures(
Example - Get Full Size Images (all default options):
```javascript
window.imagePicker.getPictures(
function(results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
console.log('Error: ' + error);
}
function(results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
console.log('Error: ' + error);
}
);
```

Example - Get at most 10 images scaled to width of 800:
```javascript
window.imagePicker.getPictures(
function(results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
console.log('Error: ' + error);
}, {
maximumImagesCount: 10,
width: 800
}
function(results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
console.log('Error: ' + error);
}, {
maximumImagesCount: 10,
width: 800
}
);
```

### Options

options = {
// max images to be selected, defaults to 15. If this is set to 1, upon
// selection of a single image, the plugin will return it.
maximumImagesCount: int,

// max width and height to allow the images to be. Will keep aspect
// ratio no matter what. So if both are 800, the returned image
// will be at most 800 pixels wide and 800 pixels tall. If the width is
// 800 and height 0 the image will be 800 pixels wide if the source
// is at least that wide.
width: int,
height: int,

// quality of resized image, defaults to 100
quality: int (0-100)
// Android only. Max images to be selected, defaults to 15. If this is set to 1, upon
// selection of a single image, the plugin will return it.
maximumImagesCount: int,

// max width and height to allow the images to be. Will keep aspect
// ratio no matter what. So if both are 800, the returned image
// will be at most 800 pixels wide and 800 pixels tall. If the width is
// 800 and height 0 the image will be 800 pixels wide if the source
// is at least that wide.
width: int,
height: int,

// quality of resized image, defaults to 100
quality: int (0-100),

// output type, defaults to FILE_URIs.
// available options are
// window.imagePicker.OutputType.FILE_URI (0) or
// window.imagePicker.OutputType.BASE64_STRING (1)
outputType: int
};

### Note for Android Use

The plugin returns images that are stored in a temporary directory. These images will often not be deleted automatically though. The files should be moved or deleted after you get their filepaths in javascript.
When outputType is FILE_URI the plugin returns images that are stored in a temporary directory. These images will often not be deleted automatically though. The files should be moved or deleted after you get their filepaths in javascript. If Base64 Strings are being returned, there is nothing to clean up.

## Android 6 (M) Permissions
On Android 6 you need to request permission to read external storage at runtime when targeting API level 23+.
Even if the `uses-permission` tags for the Calendar are present in `AndroidManifest.xml`.

Note that the `hasReadPermission` function will return true when:

- You're running this on iOS, or
- You're targeting an API level lower than 23, or
- You're using Android < 6, or
- You've already granted permission.

```js
function hasReadPermission() {
window.imagePicker.hasReadPermission(
function(result) {
// if this is 'false' you probably want to call 'requestReadPermission' now
alert(result);
}
)
}

function requestReadPermission() {
// no callbacks required as this opens a popup which returns async
window.imagePicker.requestReadPermission();
}
```

Note that backward compatibility was added by checking for read permission automatically when `getPictures` is called.
If permission is needed the plugin will now show the permission request popup.
The user will then need to allow access and invoke the same method again after doing so.


## Libraries used

Expand Down Expand Up @@ -109,4 +152,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
53 changes: 53 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>ImagePicker demo</title>
</head>
<body>
<div class="app">
<h1>ImagePicker demo</h1>

<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>

<p class="event received">Device is Ready</p>
<button onclick="getPics()">get pics</button>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
function getPics() {
imagePicker.getPictures(
function (result) {
var content = '';
for (var i = 0; i < result.length; i++) {
content += '<img src="' + result[i] + '" style="max-width:200px"/>';
//content += '<img src="data:image/jpg;base64,'+result[i]+'" style="max-width:200px"/>';
}
document.getElementById("imageOutput").innerHTML = content;
}, function (error) {
alert('Error: ' + error);
}, {
// if no title is passed, the plugin should use a sane default (preferrably the same as it was, so check the old one.. there are screenshots in the marketplace doc)
maximumImagesCount: 10,
title: 'Select pix',
message: 'Pick max 10 items', // optional default no helper message above the picker UI
// be careful with these options as they require additional processing
width: 400,
quality: 80
// outputType: imagePicker.OutputType.BASE64_STRING
}
);
}
</script>

<div id="imageOutput">
</div>

</body>
</html>
Loading