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); } } }
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(); } }
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; }
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(); } }