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:
@@ -94,7 +94,6 @@ export class NewPublicationPage implements OnInit {
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera
|
||||
|
||||
});
|
||||
const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
@@ -103,12 +102,9 @@ export class NewPublicationPage implements OnInit {
|
||||
filepath: "soon...",
|
||||
webviewPath: capturedImage.webPath
|
||||
});
|
||||
|
||||
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
|
||||
//console.log(this.capturedImage);
|
||||
|
||||
}
|
||||
|
||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
@@ -120,7 +116,28 @@ export class NewPublicationPage implements OnInit {
|
||||
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({
|
||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||
})
|
||||
@@ -132,8 +149,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImage = imageData;
|
||||
this.capturedImageTitle = file.name
|
||||
};
|
||||
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
runValidation() {
|
||||
|
||||
Reference in New Issue
Block a user