Fairoj :frontend image watermark issue fixes
This commit is contained in:
parent
3c370bc63b
commit
99a1b48f68
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="com.sineedge.pdgenie" version="0.0.16" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="com.sineedge.pdgenie" version="0.0.17" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<name>PD Genie Officer </name>
|
<name>PD Genie Officer </name>
|
||||||
<description>info@pdgenie.com</description>
|
<description>info@pdgenie.com</description>
|
||||||
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>
|
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>
|
||||||
|
|||||||
@ -99,7 +99,7 @@
|
|||||||
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
|
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
|
||||||
</mat-card> -->
|
</mat-card> -->
|
||||||
<div *ngSwitchCase="'1'" #picContent>
|
<div *ngSwitchCase="'1'" #picContent>
|
||||||
<page-pd-general-images #childComp [pd_values]=pd_value_params ></page-pd-general-images>
|
<page-pd-general-images #childComp (imageDatalength_forParent)="imageDataFun($event)" [pd_values]=pd_value_params ></page-pd-general-images>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -173,7 +173,7 @@ export class PdQuestionAddressPage {
|
|||||||
console.log("ionViewDidLoad PdQuestionAddressPage")
|
console.log("ionViewDidLoad PdQuestionAddressPage")
|
||||||
//this.getaddressForm();
|
//this.getaddressForm();
|
||||||
// this.getaddressFormFromLocal(); //FOR GETTING DATA FROM LOCAL STORAGE IF IT IS TRUE
|
// this.getaddressFormFromLocal(); //FOR GETTING DATA FROM LOCAL STORAGE IF IT IS TRUE
|
||||||
// this.getPDImages();
|
this.getPDImages();
|
||||||
|
|
||||||
}
|
}
|
||||||
tabChange(){
|
tabChange(){
|
||||||
@ -1616,4 +1616,15 @@ else{
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
imageDataFun($event){
|
||||||
|
console.log($event)
|
||||||
|
this.imageDisplay=$event.imageDisplay
|
||||||
|
this.imageDisplay.forEach(result=>{
|
||||||
|
let img_title = (result.Name).split('(');
|
||||||
|
if(img_title[0] == 'Approach to PD Location '){
|
||||||
|
this.AppxPDLocationImgValid = true;
|
||||||
|
//this.imageDisplay = this.imageDisplay.filter (value=>value.is_show_report != 0 && value.name.split('(')[0] != 'Approach to PD Location ')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1777,11 +1777,13 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
const control = <FormArray>this.businessForm.controls['documents'];
|
const control = <FormArray>this.businessForm.controls['documents'];
|
||||||
const control_with_index = <FormArray>control.controls[index];
|
const control_with_index = <FormArray>control.controls[index];
|
||||||
this.cameraProvider.getpicture().then(res => {
|
this.cameraProvider.getpicture().then(res => {
|
||||||
control_with_index.controls['document_pic'].setValue(res != 'error' ? res : '');
|
|
||||||
let img_name=control_with_index.controls['document'].value
|
|
||||||
if(res != 'error'){
|
if(res != 'error'){
|
||||||
this.cons.getGeoTag().then(geoCoordinates=>{
|
// this.cons.getGeoTag().then(geoCoordinates=>{
|
||||||
|
let geoCoordinates=localStorage.getItem('current_coordinates')
|
||||||
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
||||||
|
control_with_index.controls['document_pic'].setValue(res != 'error' ? watermarkedImage : '');
|
||||||
|
let img_name=control_with_index.controls['document'].value
|
||||||
let bucket:any=[]
|
let bucket:any=[]
|
||||||
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
|
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
|
||||||
let records: any = {
|
let records: any = {
|
||||||
@ -1797,7 +1799,7 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
console.log("Camera Error ", JSON.stringify(error));
|
console.log("Camera Error ", JSON.stringify(error));
|
||||||
@ -2712,19 +2714,22 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
|
|
||||||
ImageUpload(Flag: any) {
|
ImageUpload(Flag: any) {
|
||||||
let img_name
|
let img_name
|
||||||
|
|
||||||
this.cameraProvider.getpicture().then(res => {
|
this.cameraProvider.getpicture().then(res => {
|
||||||
if (Flag == 1) { this.businessForm.controls.shop_eat_act_cert_pic.setValue(res != 'error' ? res : ''); img_name="shop_eat_act_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 2) { this.businessForm.controls.gst_Regn_cert_pic.setValue(res != 'error' ? res : ''); img_name="gst_Regn_cert_pic" }//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 3) { this.businessForm.controls.export_import_cert_pic.setValue(res != 'error' ? res : ''); img_name="export_import_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 4) { this.businessForm.controls.factory_cert_pic.setValue(res != 'error' ? res : ''); img_name="factory_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 5) { this.businessForm.controls.practice_cert_pic.setValue(res != 'error' ? res : ''); img_name="practice_cert_pic"}// alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 6) { this.businessForm.controls.pf_regn_pic.setValue(res != 'error' ? res : ''); img_name="pf_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 7) { this.businessForm.controls.esic_regn_pic.setValue(res != 'error' ? res : ''); img_name="esic_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 8) { this.businessForm.controls.fire_noc_pic.setValue(res != 'error' ? res : ''); img_name="fire_noc_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if (Flag == 9) { this.businessForm.controls.eb_bill_pic.setValue(res != 'error' ? res : ''); img_name="eb_bill_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
|
||||||
if(res != 'error'){
|
if(res != 'error'){
|
||||||
this.cons.getGeoTag().then(geoCoordinates=>{
|
let geoCoordinates=localStorage.getItem('current_coordinates')
|
||||||
|
// this.cons.getGeoTag().then(geoCoordinates=>{
|
||||||
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{
|
||||||
|
if (Flag == 1) { this.businessForm.controls.shop_eat_act_cert_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="shop_eat_act_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 2) { this.businessForm.controls.gst_Regn_cert_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="gst_Regn_cert_pic" }//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 3) { this.businessForm.controls.export_import_cert_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="export_import_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 4) { this.businessForm.controls.factory_cert_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="factory_cert_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 5) { this.businessForm.controls.practice_cert_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="practice_cert_pic"}// alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 6) { this.businessForm.controls.pf_regn_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="pf_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 7) { this.businessForm.controls.esic_regn_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="esic_regn_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 8) { this.businessForm.controls.fire_noc_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="fire_noc_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
if (Flag == 9) { this.businessForm.controls.eb_bill_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="eb_bill_pic"}//alert('Inside Mobile Upload Function' + Flag);}
|
||||||
|
|
||||||
let bucket:any=[]
|
let bucket:any=[]
|
||||||
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
|
bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates });
|
||||||
let records: any = {
|
let records: any = {
|
||||||
@ -2740,7 +2745,7 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
console.log("Camera Error ", JSON.stringify(error));
|
console.log("Camera Error ", JSON.stringify(error));
|
||||||
|
|||||||
@ -669,7 +669,7 @@ dataobj:any;
|
|||||||
control.patchValue({
|
control.patchValue({
|
||||||
|
|
||||||
applicant_title_name:val.applicant_title_name,
|
applicant_title_name:val.applicant_title_name,
|
||||||
applicant_name:val.applicant_name,
|
applicant_name:this.generalForm.controls.individuals['controls'][0].controls.applicant_name.value,
|
||||||
is_person_met:val.is_person_met,
|
is_person_met:val.is_person_met,
|
||||||
// is_person_met_pic : val.is_person_met_pic != null ? val.is_person_met_pic : '',
|
// is_person_met_pic : val.is_person_met_pic != null ? val.is_person_met_pic : '',
|
||||||
// is_person_met_id_proof: val.is_person_met_id_proof,
|
// is_person_met_id_proof: val.is_person_met_id_proof,
|
||||||
@ -799,6 +799,7 @@ dataobj:any;
|
|||||||
params.fk_pd_id=this.pdDetails.pd_id
|
params.fk_pd_id=this.pdDetails.pd_id
|
||||||
params.fk_createdby=this.users;
|
params.fk_createdby=this.users;
|
||||||
params.hasOwnProperty('pd_co_applicant_id') ? params.pd_co_applicant_id : params.pd_co_applicant_id=''
|
params.hasOwnProperty('pd_co_applicant_id') ? params.pd_co_applicant_id : params.pd_co_applicant_id=''
|
||||||
|
params.applicant_name=this.generalForm.controls.individuals['controls'][0].controls.applicant_name.value
|
||||||
this.cons.getGeoTag().then(res=>{
|
this.cons.getGeoTag().then(res=>{
|
||||||
// console.log("Geo Coords",res)
|
// console.log("Geo Coords",res)
|
||||||
params.link=res
|
params.link=res
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { Camera } from '@ionic-native/camera';
|
|||||||
import { Platform } from 'ionic-angular';
|
import { Platform } from 'ionic-angular';
|
||||||
import { ConstantsProvider } from '../constants/constants';
|
import { ConstantsProvider } from '../constants/constants';
|
||||||
import * as watermark from 'watermarkjs'
|
import * as watermark from 'watermarkjs'
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Generated class for the CameraProvider provider.
|
Generated class for the CameraProvider provider.
|
||||||
@ -15,6 +16,7 @@ import * as watermark from 'watermarkjs'
|
|||||||
export class CameraProvider {
|
export class CameraProvider {
|
||||||
myObject: any;
|
myObject: any;
|
||||||
geoCords: any='-';
|
geoCords: any='-';
|
||||||
|
pipe=new DatePipe('en-US');
|
||||||
|
|
||||||
constructor(public http: HttpClient,public camera:Camera,private platform:Platform,private constant:ConstantsProvider) {
|
constructor(public http: HttpClient,public camera:Camera,private platform:Platform,private constant:ConstantsProvider) {
|
||||||
console.log(
|
console.log(
|
||||||
@ -41,7 +43,7 @@ export class CameraProvider {
|
|||||||
localStorage.removeItem('current_coordinates')
|
localStorage.removeItem('current_coordinates')
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
quality: 60,
|
quality: 75,
|
||||||
destinationType: this.camera.DestinationType.DATA_URL,
|
destinationType: this.camera.DestinationType.DATA_URL,
|
||||||
targetWidth: 500,
|
targetWidth: 500,
|
||||||
targetHeight: 600,
|
targetHeight: 600,
|
||||||
@ -113,7 +115,8 @@ export class CameraProvider {
|
|||||||
console.log("corrds",this.geoCords)
|
console.log("corrds",this.geoCords)
|
||||||
let raw_img = base64Img
|
let raw_img = base64Img
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
let today_loc = today.toLocaleString('en-US', { timeZone: "Asia/Kolkata" })
|
// let today_loc = today.toLocaleString('en-US', { timeZone: "Asia/Kolkata" })
|
||||||
|
let today_loc=this.pipe.transform(today, 'yyyy-MM-dd, h:mm a')
|
||||||
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
|
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
|
||||||
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||||
var dateTime = 'Date : ' + today_loc;
|
var dateTime = 'Date : ' + today_loc;
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
|||||||
userPoolId:'ap-south-1_qQ85yQZJO',
|
userPoolId:'ap-south-1_qQ85yQZJO',
|
||||||
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
||||||
}
|
}
|
||||||
return testing;
|
return production;
|
||||||
}
|
}
|
||||||
|
|
||||||
getcurrentDate()
|
getcurrentDate()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user