diff --git a/controllers/ListManagementController.php b/controllers/ListManagementController.php index b6cf785d..fe67f6d2 100644 --- a/controllers/ListManagementController.php +++ b/controllers/ListManagementController.php @@ -381,7 +381,18 @@ class ListManagementController extends Controller { $fileName = "face_" . $key . "_" . time() . ".png"; $img = file_get_contents($value); if ($img !== "null") { - file_put_contents($targetPath . "/" . $fileName, $img); + $im = imagecreatefromstring($img); + $width = imagesx($im); + $height = imagesy($im); + $newwidth = 224; + $newheight = 224; + $thumb = imagecreatetruecolor($newwidth, $newheight); + imagecopyresized($thumb, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + $fileTarget = $targetPath . "/" . $fileName; + imagejpeg($thumb, $fileTarget); + imagedestroy($thumb); + imagedestroy($im); +// file_put_contents($fileTarget, $img); $features = json_decode(common::requestToEngine("/get-feature", [ "image_paths" => [ ["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]