1 import { Component, OnInit } from '@angular/core';
3 import { EaltserviceService } from '../ealtservice.service'
5 import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
8 selector: 'app-pcbimages',
9 templateUrl: './pcbimages.component.html',
10 styleUrls: ['./pcbimages.component.scss']
12 export class PcbimagesComponent implements OnInit {
14 input_images = ["./../../assets/images/input_images/01_spurious_copper_03.jpg","./../../assets/images/input_images/04_missing_hole_04.jpg","./../../assets/images/input_images/07_spurious_copper_05.jpg","./../../assets/images/input_images/09_missing_hole_04.jpg","./../../assets/images/input_images/09_spurious_copper_09.jpg","./../../assets/images/input_images/11_open_circuit_03.jpg"];
29 private serviceobj: EaltserviceService,
30 private sanitizer: DomSanitizer
34 // this.inputimg == false;
35 // this.getImage(this.data);
36 this.cam = JSON.parse(localStorage.getItem('camera'));
37 this.edge = JSON.parse(localStorage.getItem('edgesite'));
38 this.data = this.edge + '/' + this.cam;
40 this.getImage(this.data);
45 //let myCompOneObj = new CompOneComponent();
47 this.serviceobj.getInputImage(data)
48 .subscribe( (data:any) => {
52 let objectURL = 'data:image/jpeg;base64,' + data.image01;
53 this.thumbnail = this.sanitizer.bypassSecurityTrustUrl(objectURL);
55 // let objectURL01 = 'data:image/jpeg;base64,' + data.image01;
56 let objectURL02 = 'data:image/jpeg;base64,' + data.image02;
57 let objectURL03 = 'data:image/jpeg;base64,' + data.image03;
58 let objectURL04 = 'data:image/jpeg;base64,' + data.image04;
59 let objectURL05 = 'data:image/jpeg;base64,' + data.image05;
62 // this.thumbnail01 = this.sanitizer.bypassSecurityTrustUrl(objectURL01);
63 this.thumbnail02 = this.sanitizer.bypassSecurityTrustUrl(objectURL02);
64 this.thumbnail03 = this.sanitizer.bypassSecurityTrustUrl(objectURL03);
65 this.thumbnail04 = this.sanitizer.bypassSecurityTrustUrl(objectURL04);
66 this.thumbnail05 = this.sanitizer.bypassSecurityTrustUrl(objectURL05);
69 error => console.log(error));