Browse Source

Bugfix: The function "exif_imagetype" doesn't seem to be available at every system. So we emulate it.

pull/792/head
Michael Vogel 8 years ago
parent
commit
d6f3de09e8
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      boot.php

+ 24
- 0
boot.php View File

@ -2175,3 +2175,27 @@ function set_template_engine(&$a, $engine = 'internal') {
$a->set_template_engine($engine);
}
if(!function_exists('exif_imagetype')) {
function exif_imagetype($file) {
$size = getimagesize($file);
switch ($size["mime"]) {
case "image/jpeg":
$imagetype = IMAGETYPE_JPEG;
break;
case "image/gif":
$imagetype = IMAGETYPE_GIF;
break;
case "image/png":
$imagetype = IMAGETYPE_PNG;
break;
case "":
$imagetype = "";
break;
default:
$imagetype = 99;
}
return($imagetype);
}
}

Loading…
Cancel
Save