mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix image
This commit is contained in:
@@ -14,7 +14,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { formatDate } from 'src/plugin/momentG.js'
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
|
||||
import { Filesystem, Directory, Encoding, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem';
|
||||
import { NgxImageCompressService } from "ngx-image-compress";
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
|
||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
|
||||
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.Base64" style="height: 69px; width: 69px;"></ion-img>
|
||||
name="image" ngDefaultControl [src]="seleted.url" style="height: 69px; width: 69px;"></ion-img>
|
||||
|
||||
<video class="sdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' " width="70" height="70"
|
||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||
|
||||
@@ -768,44 +768,44 @@ console.log(stringGerada);
|
||||
|
||||
async showCroppModal() {
|
||||
|
||||
// const modal = await this.modalController.create({
|
||||
// component: CropImagePage,
|
||||
// componentProps: {
|
||||
// base64ToCroppe: this.capturedImage
|
||||
// },
|
||||
// cssClass: 'modal modal-desktop'
|
||||
// });
|
||||
const modal = await this.modalController.create({
|
||||
component: CropImagePage,
|
||||
componentProps: {
|
||||
base64ToCroppe: this.capturedImage
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
// modal.onDidDismiss().then((res) => {
|
||||
// if (res) {
|
||||
// this.capturedImage = res.data
|
||||
// this.filecontent = true;
|
||||
// this.photoOrVideo = false;
|
||||
modal.onDidDismiss().then((res) => {
|
||||
if (res) {
|
||||
this.capturedImage = res.data
|
||||
this.filecontent = true;
|
||||
this.photoOrVideo = false;
|
||||
|
||||
// const newAttachment = new PublicationAttachmentEntity(
|
||||
// {
|
||||
// base64: res.data.base64ToCroppe,
|
||||
// extension: 'jpeg',
|
||||
// OriginalFileName: "image",
|
||||
// FileType: 'image'
|
||||
// }
|
||||
// )
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: res.data.base64ToCroppe,
|
||||
extension: 'jpeg',
|
||||
OriginalFileName: "image",
|
||||
FileType: 'image'
|
||||
}
|
||||
)
|
||||
|
||||
// this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
// }
|
||||
// }, (error) => {
|
||||
// console.log(error)
|
||||
// });
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
}
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
// await modal.present();
|
||||
await modal.present();
|
||||
|
||||
let fileObject = new PublicationAttachmentEntity({
|
||||
base64: this.removeTextBeforeSlash(this.capturedImage, ',') ,
|
||||
extension: 'jpeg',
|
||||
OriginalFileName: 'video',
|
||||
FileType: 'image'
|
||||
})
|
||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
||||
// let fileObject = new PublicationAttachmentEntity({
|
||||
// base64: this.removeTextBeforeSlash(this.capturedImage, ',') ,
|
||||
// extension: 'jpeg',
|
||||
// OriginalFileName: 'video',
|
||||
// FileType: 'image'
|
||||
// })
|
||||
// this.PublicationFromMvService.form.Files.push(fileObject)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user