fix image

This commit is contained in:
Peter Maquiran
2024-04-09 11:28:08 +01:00
parent 3600ed6cd5
commit c0390da857
3 changed files with 35 additions and 35 deletions
@@ -14,7 +14,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemePalette } from '@angular/material/core'; import { ThemePalette } from '@angular/material/core';
import { formatDate } from 'src/plugin/momentG.js' import { formatDate } from 'src/plugin/momentG.js'
import { ThemeService } from 'src/app/services/theme.service'; 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 { Filesystem, Directory, Encoding, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress"; import { NgxImageCompressService } from "ngx-image-compress";
@@ -64,7 +64,7 @@
</div> </div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" <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" <video class="sdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' " width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline"> preload="metadata" webkit-playsinline="webkit-playsinline">
@@ -768,44 +768,44 @@ console.log(stringGerada);
async showCroppModal() { async showCroppModal() {
// const modal = await this.modalController.create({ const modal = await this.modalController.create({
// component: CropImagePage, component: CropImagePage,
// componentProps: { componentProps: {
// base64ToCroppe: this.capturedImage base64ToCroppe: this.capturedImage
// }, },
// cssClass: 'modal modal-desktop' cssClass: 'modal modal-desktop'
// }); });
// modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
// if (res) { if (res) {
// this.capturedImage = res.data this.capturedImage = res.data
// this.filecontent = true; this.filecontent = true;
// this.photoOrVideo = false; this.photoOrVideo = false;
// const newAttachment = new PublicationAttachmentEntity( const newAttachment = new PublicationAttachmentEntity(
// { {
// base64: res.data.base64ToCroppe, base64: res.data.base64ToCroppe,
// extension: 'jpeg', extension: 'jpeg',
// OriginalFileName: "image", OriginalFileName: "image",
// FileType: 'image' FileType: 'image'
// } }
// ) )
// this.PublicationFromMvService.form.Files.push(newAttachment) this.PublicationFromMvService.form.Files.push(newAttachment)
// } }
// }, (error) => { }, (error) => {
// console.log(error) console.log(error)
// }); });
// await modal.present(); await modal.present();
let fileObject = new PublicationAttachmentEntity({ // let fileObject = new PublicationAttachmentEntity({
base64: this.removeTextBeforeSlash(this.capturedImage, ',') , // base64: this.removeTextBeforeSlash(this.capturedImage, ',') ,
extension: 'jpeg', // extension: 'jpeg',
OriginalFileName: 'video', // OriginalFileName: 'video',
FileType: 'image' // FileType: 'image'
}) // })
this.PublicationFromMvService.form.Files.push(fileObject) // this.PublicationFromMvService.form.Files.push(fileObject)
} }
} }