mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
pull from developer-prod made
This commit is contained in:
@@ -14,6 +14,7 @@ import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||
import { Directory, Encoding, Filesystem } from '@capacitor/filesystem';
|
||||
import { utf8Encode } from '@angular/compiler/src/util';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -60,7 +61,8 @@ export class NewPublicationPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public PublicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
|
||||
@@ -145,6 +147,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
|
||||
this.capturedImageTitle = 'foto';
|
||||
|
||||
/* if(validation.isOk) { */
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
this.capturedImage,
|
||||
800, // maxWidth
|
||||
@@ -157,6 +160,9 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
this.seletedContent.push(fileObject)
|
||||
});
|
||||
/* } else {
|
||||
this.toastService._badRequest("Imagem inválida")
|
||||
} */
|
||||
}
|
||||
|
||||
async laodPicture() {
|
||||
@@ -211,6 +217,27 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
/* this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String;
|
||||
this.capturedImageTitle = 'foto';
|
||||
|
||||
|
||||
const validation = await this.FileValidatorService.ValidateImage(this.capturedImage)
|
||||
|
||||
if(validation.isOk) {
|
||||
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
this.capturedImage,
|
||||
800, // maxWidth
|
||||
800, // maxHeight
|
||||
0.9 // quality
|
||||
).then((picture) => {
|
||||
console.log('Selected: ', picture)
|
||||
this.capturedImage = picture
|
||||
});
|
||||
} else {
|
||||
this.toastService._badRequest("Imagem inválida")
|
||||
} */
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -320,7 +347,6 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
} */
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
let time = new Date()
|
||||
|
||||
Reference in New Issue
Block a user