I have restricted my program to accept only images with a 16:9 ratio by basically getting image size and seeing if width/height = 16:9.
Is it possible to make my program take any image and resize/rescale it to 16:9 without making the image look weird?
This is my code:
global $config;
$tempFile = $_FILES['file']['tmp_name'];
$mimeType = mime_content_type($tempFile);
$fileName = md5(uniqid());
switch($mimeType){
case "image/jpeg":
$filePath = "images/";
$extension = IMAGETYPE_JPEG;
break;
case "image/png":
$filePath = "images/";
$extension = IMAGETYPE_PNG;
break;
case "video/mp4":
$filePath = "videos/";
$extension = ".mp4";
break;
}
$targetFile = $config['GENERAL']['UPLOAD_PATH'].$filePath.$fileName.$extension;
move_uploaded_file($tempFile,$targetFile);