mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
Generated
+3
-3
@@ -2031,9 +2031,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@capacitor/android": {
|
"@capacitor/android": {
|
||||||
"version": "3.3.0",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.1.tgz",
|
||||||
"integrity": "sha512-dzbzdN7KjjwpUbg7mZKVkgAVytEwGyXUL4Z1t9c12UhViJaNjU7/nSlTXjb+IiauwVg9oI2LHtSVrp1NIjUycw=="
|
"integrity": "sha512-TB9UJh6/e6CV6KDpu/lNHKhgVvnDL2d3crNYtfKzp64CzeZhttQGIQShXSdMb3DG4kk7Zi/qBlfSaWBBD95NhQ=="
|
||||||
},
|
},
|
||||||
"@capacitor/app": {
|
"@capacitor/app": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
"@angular/platform-browser": "~12.1.2",
|
"@angular/platform-browser": "~12.1.2",
|
||||||
"@angular/platform-browser-dynamic": "~12.1.2",
|
"@angular/platform-browser-dynamic": "~12.1.2",
|
||||||
"@angular/router": "~12.1.2",
|
"@angular/router": "~12.1.2",
|
||||||
"@capacitor/android": "^3.3.0",
|
"@capacitor/android": "^3.3.1",
|
||||||
"@capacitor/app": "^1.0.5",
|
"@capacitor/app": "^1.0.5",
|
||||||
"@capacitor/camera": "^1.2.0",
|
"@capacitor/camera": "^1.2.0",
|
||||||
"@capacitor/core": "^3.3.0",
|
"@capacitor/core": "^3.3.0",
|
||||||
|
|||||||
@@ -118,7 +118,28 @@ async takePicture() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
laodPicture() {
|
async laodPicture() {
|
||||||
|
const capturedImage = await Camera.getPhoto({
|
||||||
|
resultType: CameraResultType.Uri,
|
||||||
|
source: CameraSource.Photos,
|
||||||
|
quality: 90,
|
||||||
|
width: 1080,
|
||||||
|
height: 720,
|
||||||
|
});
|
||||||
|
|
||||||
|
const response = await fetch(capturedImage.webPath!);
|
||||||
|
const blob = await response.blob();
|
||||||
|
|
||||||
|
this.photos.unshift({
|
||||||
|
filepath: "soon...",
|
||||||
|
webviewPath: capturedImage.webPath
|
||||||
|
});
|
||||||
|
|
||||||
|
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||||
|
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* laodPicture() {
|
||||||
const input = this.fileLoaderService.createInput({
|
const input = this.fileLoaderService.createInput({
|
||||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||||
})
|
})
|
||||||
@@ -133,30 +154,10 @@ async takePicture() {
|
|||||||
console.log(this.capturedImage)
|
console.log(this.capturedImage)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* getPicture() {
|
|
||||||
const options: CameraOptions = {
|
|
||||||
quality: 90,
|
|
||||||
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
|
|
||||||
destinationType: this.camera.DestinationType.DATA_URL,
|
|
||||||
encodingType: this.camera.EncodingType.JPEG,
|
|
||||||
mediaType: this.camera.MediaType.PICTURE,
|
|
||||||
targetWidth: 720,
|
|
||||||
targetHeight: 720,
|
|
||||||
}
|
|
||||||
|
|
||||||
this.camera.getPicture(options).then((imageData) => {
|
|
||||||
// imageData is either a base64 encoded string or a file URI
|
|
||||||
// If it's base64 (DATA_URL):
|
|
||||||
let base64Image = 'data:image/jpeg;base64,' + imageData;
|
|
||||||
this.capturedImage = imageData;
|
|
||||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
|
||||||
}, (err) => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true
|
this.validateFrom = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
// allowEditing: true,
|
// allowEditing: true,
|
||||||
resultType: CameraResultType.Uri,
|
resultType: CameraResultType.Uri,
|
||||||
source: CameraSource.Camera
|
source: CameraSource.Camera
|
||||||
|
|
||||||
});
|
});
|
||||||
const response = await fetch(capturedImage.webPath!);
|
const response = await fetch(capturedImage.webPath!);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
@@ -103,12 +102,9 @@ export class NewPublicationPage implements OnInit {
|
|||||||
filepath: "soon...",
|
filepath: "soon...",
|
||||||
webviewPath: capturedImage.webPath
|
webviewPath: capturedImage.webPath
|
||||||
});
|
});
|
||||||
|
|
||||||
this.capturedImage = await this.convertBlobToBase64(blob);
|
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||||
|
|
||||||
//console.log(this.capturedImage);
|
//console.log(this.capturedImage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||||
@@ -120,7 +116,28 @@ export class NewPublicationPage implements OnInit {
|
|||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
});
|
});
|
||||||
|
|
||||||
laodPicture() {
|
async laodPicture() {
|
||||||
|
const capturedImage = await Camera.getPhoto({
|
||||||
|
resultType: CameraResultType.Uri,
|
||||||
|
source: CameraSource.Photos,
|
||||||
|
quality: 90,
|
||||||
|
width: 1080,
|
||||||
|
height: 720,
|
||||||
|
});
|
||||||
|
|
||||||
|
const response = await fetch(capturedImage.webPath!);
|
||||||
|
const blob = await response.blob();
|
||||||
|
|
||||||
|
this.photos.unshift({
|
||||||
|
filepath: "soon...",
|
||||||
|
webviewPath: capturedImage.webPath
|
||||||
|
});
|
||||||
|
|
||||||
|
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||||
|
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* laodPicture() {
|
||||||
const input = this.fileLoaderService.createInput({
|
const input = this.fileLoaderService.createInput({
|
||||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||||
})
|
})
|
||||||
@@ -132,8 +149,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
this.capturedImage = imageData;
|
this.capturedImage = imageData;
|
||||||
this.capturedImageTitle = file.name
|
this.capturedImageTitle = file.name
|
||||||
};
|
};
|
||||||
|
} */
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
|
|||||||
Reference in New Issue
Block a user