-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimg.php
90 lines (78 loc) · 2.57 KB
/
img.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/* ========================================================================
*
* @license This source file is subject to version 3.01 of the PHP license,
* that is available at http://www.php.net/license/3_01.txt
* If you did not receive a copy of the PHP license and are unable
* to obtain it through the world-wide-web, please send a note to
* [email protected] so we can mail you a copy immediately.
*
* @category Application of MyNETS
* @project OpenPNE UsagiProject 2006-2007
* @package MyNETS
* @author UsagiProject <[email protected]>
* @copyright 2006-2007 UsagiProject <author member ad http://usagi.mynets.jp/member.html>
* @version MyNETS,v 1.0.0
* @since File available since Release 1.0.0 Nighty
* @chengelog [2007/02/17] Ver1.1.0Nighty package
* ========================================================================
*/
/*
* @copyright 2005-2006 OpenPNE Project
* @link http://www.tejimaya.com/openpne.shtml
*/
require_once './config.inc.php';
// エラー出力を抑制
ini_set('display_errors', false);
ob_start();
// include_path の設定
include_once OPENPNE_LIB_DIR . '/include/PHP/Compat/Constant/PATH_SEPARATOR.php';
$include_paths = array(
OPENPNE_LIB_DIR . '/include',
OPENPNE_WEBAPP_DIR . '/lib',
ini_get('include_path')
);
ini_set('include_path', implode(PATH_SEPARATOR, $include_paths));
// 各種設定
defined('OPENPNE_IMG_JPEG_QUALITY') or define('OPENPNE_IMG_JPEG_QUALITY', 75);
if (!empty($GLOBALS['_OPENPNE_DSN_LIST']['image']['dsn'])) {
$dsn = $GLOBALS['_OPENPNE_DSN_LIST']['image']['dsn'];
} else {
$dsn = $GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn'];
}
require_once 'OpenPNE/Img.php';
$options = array(
'dsn' => $dsn,
'cache_dir' => OPENPNE_IMG_CACHE_DIR,
'jpeg_quality' => OPENPNE_IMG_JPEG_QUALITY,
);
if (defined('USE_IMAGEMAGICK')) {
switch (USE_IMAGEMAGICK) {
case 0:
$use_IM = false;
break;
case 1:
$pieces = explode('.', $_GET['filename']);
$source_format = OpenPNE_Img::check_format(array_pop($pieces));
$use_IM = ($source_format == 'gif');
break;
case 2:
$use_IM = true;
break;
default:
exit;
}
} else {
$use_IM = false;
}
if ($use_IM) {
require_once 'OpenPNE/Img/ImageMagick.php';
$img =& new OpenPNE_Img_ImageMagick($options);
} else {
$img =& new OpenPNE_Img($options);
}
$img->set_requests($_GET);
$img->generate_img() or exit(1);
while (@ob_end_clean());
$img->output_img() or exit(2);
?>