本文整理汇总了PHP中ew_ResizeFileToBinary函数的典型用法代码示例。如果您正苦于以下问题:PHP ew_ResizeFileToBinary函数的具体用法?PHP ew_ResizeFileToBinary怎么用?PHP ew_ResizeFileToBinary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ew_ResizeFileToBinary函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Page_Main
function Page_Main()
{
global $conn;
$GLOBALS["Page"] =& $this;
//***$conn = ew_Connect();
// Get fn / table name parameters
$key = EW_RANDOM_KEY . session_id();
$fn = @$_GET["fn"] != "" ? ew_StripSlashes($_GET["fn"]) : "";
if ($fn != "" && EW_ENCRYPT_FILE_PATH) {
$fn = ew_Decrypt($fn, $key);
}
$table = @$_GET["t"] != "" ? ew_StripSlashes($_GET["t"]) : "";
if ($table != "" && EW_ENCRYPT_FILE_PATH) {
$table = ew_Decrypt($table, $key);
}
// Global Page Loading event (in userfn*.php)
//***Page_Loading();
// Get resize parameters
$resize = @$_GET["resize"] != "";
$width = @$_GET["width"] != "" ? $_GET["width"] : 0;
$height = @$_GET["height"] != "" ? $_GET["height"] : 0;
if (@$_GET["width"] == "" && @$_GET["height"] == "") {
$width = EW_THUMBNAIL_DEFAULT_WIDTH;
$height = EW_THUMBNAIL_DEFAULT_HEIGHT;
}
// Resize image from physical file
if ($fn != "") {
$fn = str_replace("", "", $fn);
$fn = ew_IncludeTrailingDelimiter(ew_AppRoot(), TRUE) . $fn;
if (file_exists($fn) || @fopen($fn, "rb") !== FALSE) {
// Allow remote file
if (ob_get_length()) {
ob_end_clean();
}
$pathinfo = pathinfo($fn);
$ext = strtolower(@$pathinfo["extension"]);
$ct = ew_ContentType("", $fn);
if ($ct != "") {
header("Content-type: " . $ct);
}
if (in_array($ext, explode(",", EW_IMAGE_ALLOWED_FILE_EXT))) {
$size = @getimagesize($fn);
if ($size) {
header("Content-type: {$size['mime']}");
}
if ($width > 0 || $height > 0) {
echo ew_ResizeFileToBinary($fn, $width, $height);
} else {
echo file_get_contents($fn);
}
} elseif (in_array($ext, explode(",", EW_DOWNLOAD_ALLOWED_FILE_EXT))) {
echo file_get_contents($fn);
}
}
}
// Global Page Unloaded event (in userfn*.php)
//***Page_Unloaded();
// Close connection
//***ew_CloseConn();
}
开发者ID:NaurozAhmad,项目名称:G-Axis,代码行数:60,代码来源:ewfile12.php
示例2: ew_StripSlashes
include_once "ewcfg11.php";
include_once "adodb5/adodb.inc.php";
include_once "phpfn11.php";
// Get resize parameters
$resize = @$_GET["resize"] != "";
$width = @$_GET["width"] != "" ? $_GET["width"] : 0;
$height = @$_GET["height"] != "" ? $_GET["height"] : 0;
if (@$_GET["width"] == "" && @$_GET["height"] == "") {
$width = EW_THUMBNAIL_DEFAULT_WIDTH;
$height = EW_THUMBNAIL_DEFAULT_HEIGHT;
}
$quality = @$_GET["quality"] != "" ? $_GET["quality"] : EW_THUMBNAIL_DEFAULT_QUALITY;
// Resize image from physical file
if (@$_GET["fn"] != "") {
$fn = ew_StripSlashes($_GET["fn"]);
$fn = str_replace("", "", $fn);
$fn = ew_IncludeTrailingDelimiter(ew_AppRoot(), TRUE) . $fn;
if (file_exists($fn) || fopen($fn, "rb") !== FALSE) {
// Allow remote file
$pathinfo = pathinfo($fn);
$ext = strtolower(@$pathinfo["extension"]);
if (in_array($ext, explode(",", EW_IMAGE_ALLOWED_FILE_EXT))) {
$size = @getimagesize($fn);
if ($size) {
header("Content-type: {$size['mime']}");
}
echo ew_ResizeFileToBinary($fn, $width, $height, $quality);
}
}
exit;
}
开发者ID:erick-chali,项目名称:Ubicacion,代码行数:31,代码来源:ewbv11.php
示例3: ExportValue
function ExportValue($Export, $Original)
{
$ExportValue = $Original ? $this->CurrentValue : $this->ViewValue;
if ($Export == "xml" && is_null($ExportValue)) {
$ExportValue = "<Null>";
}
if ($Export == "pdf") {
if ($this->FldViewTag == "IMAGE") {
if ($this->FldDataType == EW_DATATYPE_BLOB) {
$wrkdata = $this->Upload->DbValue;
if (!empty($wrkdata)) {
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
ew_ResizeBinary($wrkdata, $wrkwidth, $wrkheight, $this->ResizeQuality);
}
$imagefn = ew_TmpImage($wrkdata);
if ($imagefn != "") {
$ExportValue = "<img src=\"" . $imagefn . "\">";
}
}
} else {
$wrkfile = $this->Upload->DbValue;
if (empty($wrkfile)) {
$wrkfile = $this->CurrentValue;
}
if (!empty($wrkfile)) {
$imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
$wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight, $this->ResizeQuality);
$imagefn = ew_TmpImage($wrkdata);
} else {
$imagefn = ew_TmpFile($imagefn);
}
if ($imagefn != "") {
$ExportValue = "<img src=\"" . $imagefn . "\">";
}
}
}
} else {
$ExportValue = str_replace("<br>", "\r\n", $ExportValue);
$ExportValue = strip_tags($ExportValue);
$ExportValue = str_replace("\r\n", "<br>", $ExportValue);
}
}
return $ExportValue;
}
开发者ID:Razinsky,项目名称:echaude-com,代码行数:49,代码来源:phpfn8.php
示例4: GetTempImage
function GetTempImage()
{
if ($this->FldDataType == EW_DATATYPE_BLOB) {
$wrkdata = $this->Upload->DbValue;
if (!empty($wrkdata)) {
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
ew_ResizeBinary($wrkdata, $wrkwidth, $wrkheight);
}
return ew_TmpImage($wrkdata);
}
} else {
$wrkfile = $this->Upload->DbValue;
if (empty($wrkfile)) {
$wrkfile = $this->CurrentValue;
}
if (!empty($wrkfile)) {
if (!$this->UploadMultiple) {
$imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
$wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight);
return ew_TmpImage($wrkdata);
} else {
return $imagefn;
}
} else {
$tmpfiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $wrkfile);
$tmpimage = "";
foreach ($tmpfiles as $tmpfile) {
if ($tmpfile != "") {
$imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $tmpfile;
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
$wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight);
if ($tmpimage != "") {
$tmpimage .= ",";
}
$tmpimage .= ew_TmpImage($wrkdata);
} else {
if ($tmpimage != "") {
$tmpimage .= ",";
}
$tmpimage .= ew_ConvertFullUrl($this->UploadPath . $tmpfile);
}
}
}
return $tmpimage;
}
}
}
}
开发者ID:NaurozAhmad,项目名称:Senho,代码行数:55,代码来源:phpfn12.php
示例5: Resize
function Resize($width, $height, $quality)
{
if (!is_null($this->Value)) {
$wrkwidth = $width;
$wrkheight = $height;
if ($this->IsBinary) {
$this->Binary = ew_ResizeFileToBinary($this->Value, $wrkwidth, $wrkheight, $quality);
$this->FileSize = strlen($this->Binary);
} else {
ew_ResizeFile($this->Value, $this->Value, $wrkwidth, $wrkheight, $quality);
$this->FileSize = filesize($this->Value);
}
$this->ImageWidth = $wrkwidth;
$this->ImageHeight = $wrkheight;
}
}
开发者ID:BGCX261,项目名称:zhss-svn-to-git,代码行数:16,代码来源:phpfn50.php
示例6: GetTempImage
function GetTempImage()
{
if ($this->FldDataType == EW_DATATYPE_BLOB) {
$wrkdata = $this->Upload->DbValue;
if (!empty($wrkdata)) {
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
ew_ResizeBinary($wrkdata, $wrkwidth, $wrkheight, $this->ResizeQuality);
}
return ew_TmpImage($wrkdata);
}
} else {
$wrkfile = $this->Upload->DbValue;
if (empty($wrkfile)) {
$wrkfile = $this->CurrentValue;
}
if (!empty($wrkfile)) {
$imagefn = ew_UploadPathEx(TRUE, $this->UploadPath) . $wrkfile;
if ($this->ImageResize) {
$wrkwidth = $this->ImageWidth;
$wrkheight = $this->ImageHeight;
$wrkdata = ew_ResizeFileToBinary($imagefn, $wrkwidth, $wrkheight, $this->ResizeQuality);
return ew_TmpImage($wrkdata);
} else {
return $imagefn;
}
}
}
}
开发者ID:Rastrian,项目名称:RBAC_Manager,代码行数:30,代码来源:phpfn9.php
注:本文中的ew_ResizeFileToBinary函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论