fixes 1 : ps

This commit is contained in:
VE10-Sanjeev 2022-05-28 18:06:26 +05:30
parent a0ec2417d7
commit a46450a0e7
2 changed files with 23 additions and 18 deletions

View File

@ -980,7 +980,7 @@ class PD_Controller extends REST_Controller {
// SMS_GUPSHUP::sendSMS($msg,$no,array('pd_id' => $exist_pd_details[0]['pd_id'],'status' => 'STARTED','msg' => 'Cus Link from PD controlller'));
// }
}
}// started if condition closed here.
// die();
if(isset($pd_details['pd_status']) && (($pd_details['pd_status'] == COMPLETED) || ($pd_details['pd_status'] == ADD_ON_PENDING)) )
{
@ -989,6 +989,7 @@ class PD_Controller extends REST_Controller {
{
$pd_details['complete_override_data'] = json_encode($pd_details['complete_override_data']);
$pd_details['completed_on'] = date('Y-m-d H:i:s');
log_message('ERROR',"PD Controller Completed Status Calling (toMakeFaceBoundingBox)");
$this->toMakeFaceBoundingBox($exist_pd_details);
}
@ -11927,10 +11928,11 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post()
public function toMakeFaceBoundingBox($master_details){
// $pdid = $this->get('pd');//pdid 3184 comment this
$pdid = $master_details[0]['pd_id'];
log_message('ERROR',"PD Controller inside to Make FaceBoundingBox PDID : ".$pdid);
$bounding_box = array();
if(!empty($pdid)){
// $master_details = $this->PD_Model->getPDMasterDetails($pdid);//comment this
if($master_details[0]['pd_status'] == COMPLETED && $master_details[0]['facemark_image_generated'] == 0){
if($master_details[0]['facemark_image_generated'] == 0){
$db_result = $this->PD_Model->selectCustomRecords(array('faceapi_result'),array('pd_id' => $pdid),PDTRIGGER);
$string = $db_result[0]['faceapi_result'];
// echo gettype($string);

View File

@ -4,15 +4,16 @@ class faceapi
{
public static function toMakeFaceBoundingBox($image_name,$BoundingBox,$destination_path){
$get_image_format = explode(".",$image_name);
// $image_format = $get_image_format[1];
$img = imagecreatefrompng($destination_path);
// if($image_format == 'png'){
// $img = imagecreatefrompng($destination_path);
// }else if($image_format == 'jpeg'){
// $img = imagecreatefromjpeg($destination_path);
// }else if($image_format == 'jpg'){
// $img = imagecreatefromjpg($destination_path);
// }
$image_format = $get_image_format[1];
// print_r($get_image_format);die();
// $img = imagecreatefrompng($destination_path);
if($image_format == 'png'){
$img = imagecreatefrompng($destination_path);
}else if($image_format == 'jpeg'){
$img = imagecreatefromjpeg($destination_path);
}else if($image_format == 'jpg'){
$img = imagecreatefromjpg($destination_path);
}
$red = imagecolorallocate($img, 255, 0, 0);
@ -29,7 +30,7 @@ class faceapi
$Top_coordinate = ($BoundingBox[$i]['Top'] * $imageheight) ;
$Face_width = ($BoundingBox[$i]['Width'] * $imagewidth) ;
$Face_height = ($BoundingBox[$i]['Height'] * $imageheight) ;
$Similarity = round($BoundingBox[$i]['Similarity']);
$Similarity = $BoundingBox[$i]['Similarity'];
$x1 = $Left_coordinate;
$y1 = $Top_coordinate;
@ -42,12 +43,15 @@ class faceapi
}
public static function DrawLine($x1,$y1,$Face_width,$Face_height,$Similarity,$img,$destination_path){
if($Similarity >= 70 ){// above 70 green
$Similarity_split = explode(".",$Similarity);
$Similarity_value = $Similarity_split[0];
list($imagewidth, $imageheight) = getimagesize($destination_path);
if($Similarity_value >= 70 ){// above 70 green
$color = imagecolorallocate($img, 0, 153, 0);
}else if($Similarity < 70 ){// below 70 red
}else if($Similarity_value < 70 ){// below 70 red
$color = imagecolorallocate($img, 255, 0, 0);
}
$Similarity = $Similarity." %";
$Similarity = $Similarity_value." %";
//TOP LINe
$t_x1 = $x1;
$t_y1 = $y1;
@ -73,13 +77,12 @@ class faceapi
$image_format = $get_image_format[1];
if($image_format == 'png'){
$destination_path = $get_image_format[0].".jpeg";
imagepng($img, $destination_path);
}else if($image_format == 'jpeg'){
imagejpeg($img, $destination_path);
}else if($image_format == 'jpg'){
$destination_path = $get_image_format[0].".jpeg";
imagepng($img, $destination_path);
// $destination_path = $get_image_format[0].".jpeg";
imagejpg($img, $destination_path);
}
}