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