1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: define('CON_IMAGERESIZE_GD', 1);
17:
18: define('CON_IMAGERESIZE_IMAGEMAGICK', 2);
19:
20: define('CON_IMAGERESIZE_CANTCHECK', 3);
21:
22: define('CON_IMAGERESIZE_NOTHINGAVAILABLE', 4);
23:
24: function checkImageResizer() {
25: global $cfg;
26:
27: $iGDStatus = isPHPExtensionLoaded('gd');
28:
29: if ($iGDStatus == CON_EXTENSION_AVAILABLE) {
30: return CON_IMAGERESIZE_GD;
31: }
32:
33: if (function_exists('imagecreate')) {
34: return CON_IMAGERESIZE_GD;
35: }
36:
37: checkAndInclude($cfg['path']['contenido'] . 'includes/functions.api.images.php');
38: if (cApiIsImageMagickAvailable()) {
39: return CON_IMAGERESIZE_IMAGEMAGICK;
40: }
41:
42: if ($iGDStatus === CON_EXTENSION_CANTCHECK) {
43: return CON_IMAGERESIZE_CANTCHECK;
44: } else {
45: return CON_IMAGERESIZE_NOTHINGAVAILABLE;
46: }
47: }
48:
49: ?>