1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | require_once './config.inc.php'; |
---|
8 | |
---|
9 | // エラー出力を抑制 |
---|
10 | ini_set('display_errors', false); |
---|
11 | ob_start(); |
---|
12 | |
---|
13 | // include_path の設定 |
---|
14 | include_once OPENPNE_LIB_DIR . '/include/PHP/Compat/Constant/PATH_SEPARATOR.php'; |
---|
15 | $include_paths = array( |
---|
16 | OPENPNE_LIB_DIR . '/include', |
---|
17 | OPENPNE_WEBAPP_DIR . '/lib', |
---|
18 | ini_get('include_path') |
---|
19 | ); |
---|
20 | ini_set('include_path', implode(PATH_SEPARATOR, $include_paths)); |
---|
21 | |
---|
22 | // 各種設定 |
---|
23 | defined('OPENPNE_IMG_JPEG_QUALITY') or define('OPENPNE_IMG_JPEG_QUALITY', 75); |
---|
24 | if (!empty($GLOBALS['_OPENPNE_DSN_LIST']['image']['dsn'])) { |
---|
25 | $dsn = $GLOBALS['_OPENPNE_DSN_LIST']['image']['dsn']; |
---|
26 | } else { |
---|
27 | $dsn = $GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']; |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | require_once 'OpenPNE/Img.php'; |
---|
32 | $options = array( |
---|
33 | 'dsn' => $dsn, |
---|
34 | 'cache_dir' => OPENPNE_IMG_CACHE_DIR, |
---|
35 | 'jpeg_quality' => OPENPNE_IMG_JPEG_QUALITY, |
---|
36 | ); |
---|
37 | |
---|
38 | if (defined('USE_IMAGEMAGICK') && USE_IMAGEMAGICK) { |
---|
39 | require_once 'OpenPNE/Img/ImageMagick.php'; |
---|
40 | $img =& new OpenPNE_Img_ImageMagick($options); |
---|
41 | } else { |
---|
42 | $img =& new OpenPNE_Img($options); |
---|
43 | } |
---|
44 | $img->set_requests($_GET); |
---|
45 | |
---|
46 | $img->generate_img() or exit(1); |
---|
47 | while (@ob_end_clean()); |
---|
48 | |
---|
49 | $img->output_img() or exit(2); |
---|
50 | |
---|
51 | ?> |
---|