You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
715 B
25 lines
715 B
<?php
|
|
|
|
abstract class UploadHelper
|
|
{
|
|
public static function imageCompareAspectRatio($proportion, $file_path)
|
|
{
|
|
$imagesize = getimagesize($file_path);
|
|
$proprtion_parts = explode('x', $proportion);
|
|
if ($proprtion_parts[0] / $proprtion_parts[1] === $imagesize[0] / $imagesize[1]) {
|
|
return true;
|
|
} else {
|
|
false;
|
|
}
|
|
}
|
|
public static function imageCheckMinSize($size, $file_path)
|
|
{
|
|
$imagesize = getimagesize($file_path);
|
|
$size_parts = explode('x', $size);
|
|
if ($imagesize[0] >= $size_parts[0] && $imagesize[1] >= $size_parts[1]) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|