mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
On new publication add image from gallery added
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ion-item-container-no-border">
|
<div class="ion-item-container-no-border">
|
||||||
<ion-label (click)="selectImage()">
|
<ion-label (click)="takePicture()">
|
||||||
<div class="attach-icon">
|
<div class="attach-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ion-item-container-no-border">
|
<div class="ion-item-container-no-border">
|
||||||
<ion-label (click)="laodPicture()" class="cursor-pointer">
|
<ion-label (click)="selectImage()" class="cursor-pointer">
|
||||||
<div class="attach-icon">
|
<div class="attach-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||||
|
|||||||
@@ -103,25 +103,16 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async takePicture() {
|
async takePicture() {
|
||||||
const capturedImage = await Camera.getPhoto({
|
const image = await Camera.getPhoto({
|
||||||
quality: 90,
|
quality: 90,
|
||||||
// allowEditing: true,
|
allowEditing: false,
|
||||||
resultType: CameraResultType.Uri,
|
resultType: CameraResultType.Uri,
|
||||||
source: CameraSource.Camera
|
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||||
|
|
||||||
});
|
|
||||||
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);
|
if (image) {
|
||||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
this.saveImage(image)
|
||||||
|
}
|
||||||
//console.log(this.capturedImage);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +385,7 @@ async selectImage() {
|
|||||||
quality: 90,
|
quality: 90,
|
||||||
allowEditing: false,
|
allowEditing: false,
|
||||||
resultType: CameraResultType.Uri,
|
resultType: CameraResultType.Uri,
|
||||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
source: CameraSource.Photos // Camera, Photos or Prompt!
|
||||||
});
|
});
|
||||||
|
|
||||||
if (image) {
|
if (image) {
|
||||||
|
|||||||
Reference in New Issue
Block a user