Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((images) => {
console.log('LogOut - imagemap', this._network.service.loggedInUser);
console.log('PM - images', images);
if (images && images.length > 0) {
if (images.length === 1 && images[0].mime !== 'image/gif' && Platform.OS !== 'ios') {
console.log('LogOut - singleimageselection', this._network.service.loggedInUser);
// Cropper
ImagePicker.openCropper({
path: images[0].path,
width: 1000,
height: 1000,
}).then((data) => {
console.log('LogOut - singleimagecrop', this._network.service.loggedInUser);
console.log('PM - data', data);
const _progressCallback = this._progressCallback;
new ImageUtil().uploadImage(data, this._group._id, true, 'Image',
(fuFileName, fuPercent, fuMsg) => {
console.log(fuFileName, ':', fuPercent, ':', fuMsg);
const fileNameCount = fuFileName;
console.log('LogOut - roomview', this._network.service.loggedInUser);
const percentage = Math.round(Number(parseFloat(fuPercent).toFixed(2) * 100));
if (_progressCallback) {
_progressCallback(fileNameCount, fuMsg, percentage, 1, 0);
}
openPicker() {
ImagePicker.openCropper({
path: this.state.imageSource,
width: Constants.UPLOAD_POST_PICTURE_SIZE,
height: Constants.UPLOAD_POST_PICTURE_SIZE,
cropperStatusBarColor: Colors.BASE,
cropperToolbarColor: Colors.BASE,
}).then((image) => {
const imageSource = extractImageSource(image);
this.setState({
imageSource,
hasChosen: true,
});
this.continue();
});
}