本文整理汇总了PHP中ew_ResizeBinary函数的典型用法代码示例。如果您正苦于以下问题:PHP ew_ResizeBinary函数的具体用法?PHP ew_ResizeBinary怎么用?PHP ew_ResizeBinary使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ew_ResizeBinary函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Resize
function Resize($width, $height, $quality)
{
if (!ew_Empty($this->Value)) {
$wrkwidth = $width;
$wrkheight = $height;
if (ew_ResizeBinary($this->Value, $wrkwidth, $wrkheight, $quality)) {
// P6
$this->ImageWidth = $wrkwidth;
$this->ImageHeight = $wrkheight;
$this->FileSize = strlen($this->Value);
}
}
}
示例2: Page_Main
function Page_Main()
{
// Get key
if (@$_GET["rider_id"] != "") {
$this->rider_id->setQueryStringValue($_GET["rider_id"]);
} else {
$this->Page_Terminate();
// Exit
exit;
}
$objBinary = new cUpload('rider', 'x_rider_pic');
// Show thumbnail
$bShowThumbnail = @$_GET["showthumbnail"] == "1";
if (@$_GET["thumbnailwidth"] == "" && @$_GET["thumbnailheight"] == "") {
$iThumbnailWidth = EW_THUMBNAIL_DEFAULT_WIDTH;
// Set default width
$iThumbnailHeight = EW_THUMBNAIL_DEFAULT_HEIGHT;
// Set default height
} else {
if (@$_GET["thumbnailwidth"] != "") {
$iThumbnailWidth = $_GET["thumbnailwidth"];
if (!is_numeric($iThumbnailWidth) || $iThumbnailWidth < 0) {
$iThumbnailWidth = 0;
}
}
if (@$_GET["thumbnailheight"] != "") {
$iThumbnailHeight = $_GET["thumbnailheight"];
if (!is_numeric($iThumbnailHeight) || $iThumbnailHeight < 0) {
$iThumbnailHeight = 0;
}
}
}
$sFilter = $this->KeyFilter();
// Set up filter (SQL WHERE clause) and get return SQL
// SQL constructor in rider class, riderinfo.php
$this->CurrentFilter = $sFilter;
$sSql = $this->SQL();
$conn =& $this->Connection();
if ($this->Recordset = $conn->Execute($sSql)) {
if (!$this->Recordset->EOF) {
if (ob_get_length()) {
ob_end_clean();
}
$objBinary->Value = $this->Recordset->fields('rider_pic');
$objBinary->Value = $objBinary->Value;
if ($bShowThumbnail) {
ew_ResizeBinary($objBinary->Value, $iThumbnailWidth, $iThumbnailHeight);
}
$data = $objBinary->Value;
if (strpos(ew_ServerVar("HTTP_USER_AGENT"), "MSIE") === FALSE) {
header("Content-type: " . ew_ContentType(substr($data, 0, 11), $this->Recordset->fields('rider_pic')));
}
if (trim(strval($this->Recordset->fields('rider_pic'))) != "") {
header("Content-Disposition: attachment; filename=\"" . $this->Recordset->fields('rider_pic') . "\"");
}
if (substr($data, 0, 2) == "PK" && strpos($data, "[Content_Types].xml") > 0 && strpos($data, "_rels") > 0 && strpos($data, "docProps") > 0) {
// Fix Office 2007 documents
if (substr($data, -4) != "") {
$data .= "";
}
}
echo $data;
}
$this->Recordset->Close();
}
}
示例3: Resize
function Resize($width, $height, $quality = EW_THUMBNAIL_DEFAULT_QUALITY)
{
if (!ew_Empty($this->Value)) {
$wrkwidth = $width;
$wrkheight = $height;
if (ew_ResizeBinary($this->Value, $wrkwidth, $wrkheight, $quality, $this->Plugins)) {
if ($wrkwidth > 0 && $wrkheight > 0) {
$this->ImageWidth = $wrkwidth;
$this->ImageHeight = $wrkheight;
}
$this->FileSize = strlen($this->Value);
}
}
return $this;
}
示例4: Page_Main
function Page_Main()
{
global $conn, $exam_data;
// Get key
if (@$_GET["ExamDataNo"] != "") {
$exam_data->ExamDataNo->setQueryStringValue($_GET["ExamDataNo"]);
} else {
$this->Page_Terminate();
// Exit
exit;
}
$objBinary = new cUpload('exam_data', 'x_Soap');
// Show thumbnail
$bShowThumbnail = @$_GET["showthumbnail"] == "1";
if (@$_GET["thumbnailwidth"] == "" && @$_GET["thumbnailheight"] == "") {
$iThumbnailWidth = EW_THUMBNAIL_DEFAULT_WIDTH;
// Set default width
$iThumbnailHeight = EW_THUMBNAIL_DEFAULT_HEIGHT;
// Set default height
} else {
if (@$_GET["thumbnailwidth"] != "") {
$iThumbnailWidth = $_GET["thumbnailwidth"];
if (!is_numeric($iThumbnailWidth) || $iThumbnailWidth < 0) {
$iThumbnailWidth = 0;
}
}
if (@$_GET["thumbnailheight"] != "") {
$iThumbnailHeight = $_GET["thumbnailheight"];
if (!is_numeric($iThumbnailHeight) || $iThumbnailHeight < 0) {
$iThumbnailHeight = 0;
}
}
}
if (@$_GET["quality"] != "") {
$quality = $_GET["quality"];
if (!is_numeric($quality)) {
$quality = 75;
}
// Set Default
} else {
$quality = 75;
}
$sFilter = $exam_data->KeyFilter();
// Set up filter (SQL WHERE clause) and get return SQL
// SQL constructor in exam_data class, exam_datainfo.php
$exam_data->CurrentFilter = $sFilter;
$sSql = $exam_data->SQL();
if ($rs = $conn->Execute($sSql)) {
if (!$rs->EOF) {
if (strpos(ew_ServerVar("HTTP_USER_AGENT"), "MSIE") === FALSE) {
header("Content-type: images");
}
$objBinary->Value = $rs->fields('Soap');
if ($bShowThumbnail) {
ew_ResizeBinary($objBinary->Value, $iThumbnailWidth, $iThumbnailHeight, $quality);
}
$data = $objBinary->Value;
if (substr($data, 0, 2) == "PK" && strpos($data, "[Content_Types].xml") > 0 && strpos($data, "_rels") > 0 && strpos($data, "docProps") > 0) {
// Fix Office 2007 documents
if (substr($data, -4) != "") {
$data .= "";
}
}
echo $data;
}
$rs->Close();
}
}