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.

24 lines
715 B

  1. <?php
  2. abstract class UploadHelper
  3. {
  4. public static function imageCompareAspectRatio($proportion, $file_path)
  5. {
  6. $imagesize = getimagesize($file_path);
  7. $proprtion_parts = explode('x', $proportion);
  8. if ($proprtion_parts[0] / $proprtion_parts[1] === $imagesize[0] / $imagesize[1]) {
  9. return true;
  10. } else {
  11. false;
  12. }
  13. }
  14. public static function imageCheckMinSize($size, $file_path)
  15. {
  16. $imagesize = getimagesize($file_path);
  17. $size_parts = explode('x', $size);
  18. if ($imagesize[0] >= $size_parts[0] && $imagesize[1] >= $size_parts[1]) {
  19. return true;
  20. } else {
  21. return false;
  22. }
  23. }
  24. }