本文整理匯總了PHP中image::addlogo方法的典型用法代碼示例。如果您正苦於以下問題:PHP image::addlogo方法的具體用法?PHP image::addlogo怎麽用?PHP image::addlogo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類image
的用法示例。
在下文中一共展示了image::addlogo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
} elseif (file_exists(NV_ROOTDIR . '/' . $global_config['site_logo'])) {
$upload_logo = NV_ROOTDIR . '/' . $global_config['site_logo'];
} elseif (file_exists(NV_ROOTDIR . '/images/logo.png')) {
$upload_logo = NV_ROOTDIR . '/images/logo.png';
} else {
die('ERROR#' . $lang_module['notlogo']);
}
$config_logo = array();
$config_logo['x'] = $nv_Request->get_int('x', 'post', 0);
$config_logo['y'] = $nv_Request->get_int('y', 'post', 0);
$config_logo['w'] = $nv_Request->get_int('w', 'post', 0);
$config_logo['h'] = $nv_Request->get_int('h', 'post', 0);
if ($config_logo['w'] > 0 and $config_logo['h'] > 0) {
require_once NV_ROOTDIR . '/includes/class/image.class.php';
$createImage = new image(NV_ROOTDIR . '/' . $path . '/' . $file, NV_MAX_WIDTH, NV_MAX_HEIGHT);
$createImage->addlogo($upload_logo, '', '', $config_logo);
$createImage->save(NV_ROOTDIR . '/' . $path, $file);
$createImage->close();
if (isset($array_dirname[$path])) {
if (preg_match('/^' . nv_preg_quote(NV_UPLOADS_DIR) . '\\/(([a-z0-9\\-\\_\\/]+\\/)*([a-z0-9\\-\\_\\.]+)(\\.(gif|jpg|jpeg|png)))$/i', $path . '/' . $file, $m)) {
@nv_deletefile(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $m[1]);
}
$info = nv_getFileInfo($path, $file);
$did = $array_dirname[$path];
$db->query("UPDATE " . NV_UPLOAD_GLOBALTABLE . "_file SET filesize=" . $info['filesize'] . ", src='" . $info['src'] . "', srcwidth=" . $info['srcwidth'] . ", srcheight=" . $info['srcheight'] . ", sizes='" . $info['size'] . "', userid=" . $admin_info['userid'] . ", mtime=" . $info['mtime'] . " WHERE did = " . $did . " AND title = '" . $file . "'");
}
die('OK#' . basename($file));
} else {
die('ERROR#' . $lang_module['notlevel']);
}
}
示例2: ceil
if (ceil($photo['width'] * $photo_config['autologosize3'] / 100) > $logo_size[0]) {
$w = $logo_size[0];
} else {
$w = ceil($photo['width'] * $photo_config['autologosize3'] / 100);
}
}
$h = ceil($w * $logo_size[1] / $logo_size[0]);
$x = $photo['width'] - $w - 5;
$y = $photo['height'] - $h - 5;
$config_logo = array();
$config_logo['x'] = $photo['width'] - $w - 5;
$config_logo['y'] = $photo['height'] - $h - 5;
$config_logo['w'] = $w;
$config_logo['h'] = $h;
$createImage = new image($newFilePath, NV_MAX_WIDTH, NV_MAX_HEIGHT);
$createImage->addlogo(NV_ROOTDIR . '/' . $upload_logo, '', '', $config_logo);
$createImage->save($folder_album, $basename);
}
$photo['file'] = substr($newFilePath, strlen(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/images/'));
// Copy file thumb
//$thum_folder = floor( $data['album_id'] / 1000 );
$thumbName = $fileName = substr($photo['thumb'], strlen(NV_BASE_SITEURL . NV_TEMP_DIR . '/'));
$fileName2 = $fileName;
$i = 1;
while (file_exists(NV_ROOTDIR . '/' . $currentpaththumb . '/' . $fileName2)) {
$fileName2 = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1_' . $i . '\\2', $fileName);
++$i;
}
$fileName = $fileName2;
$filePath = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $thumbName;
$newFilePath = NV_ROOTDIR . '/' . $currentpaththumb . '/' . $fileName;