當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpthumb_functions::CleanUpURLencoding方法代碼示例

本文整理匯總了PHP中phpthumb_functions::CleanUpURLencoding方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpthumb_functions::CleanUpURLencoding方法的具體用法?PHP phpthumb_functions::CleanUpURLencoding怎麽用?PHP phpthumb_functions::CleanUpURLencoding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpthumb_functions的用法示例。


在下文中一共展示了phpthumb_functions::CleanUpURLencoding方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ImageSaveAlpha

            ImageSaveAlpha($phpThumb->gdimg_source, true);
        }
        $new_background_color = phpthumb_functions::ImageHexColorAllocate($phpThumb->gdimg_source, $bghexcolor, false, $alpha);
        ImageFilledRectangle($phpThumb->gdimg_source, 0, 0, $phpThumb->w, $phpThumb->h, $new_background_color);
    } else {
        $phpThumb->ErrorImage('failed to create "new" image (' . $phpThumb->w . 'x' . $phpThumb->h . ')');
    }
} elseif (!$phpThumb->src) {
    $phpThumb->ErrorImage('Usage: ' . $_SERVER['PHP_SELF'] . '?src=/path/and/filename.jpg' . "\n" . 'read Usage comments for details');
} elseif (preg_match('/^(f|ht)tp\\:\\/\\//i', $phpThumb->src)) {
    $phpThumb->DebugMessage('$phpThumb->src (' . $phpThumb->src . ') is remote image, attempting to download', __FILE__, __LINE__);
    if ($phpThumb->config_http_user_agent) {
        $phpThumb->DebugMessage('Setting "user_agent" to "' . $phpThumb->config_http_user_agent . '"', __FILE__, __LINE__);
        ini_set('user_agent', $phpThumb->config_http_user_agent);
    }
    $cleanedupurl = phpthumb_functions::CleanUpURLencoding($phpThumb->src);
    $phpThumb->DebugMessage('CleanUpURLencoding(' . $phpThumb->src . ') returned "' . $cleanedupurl . '"', __FILE__, __LINE__);
    $phpThumb->src = $cleanedupurl;
    unset($cleanedupurl);
    if ($rawImageData = phpthumb_functions::SafeURLread($phpThumb->src, $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) {
        $phpThumb->DebugMessage('SafeURLread(' . $phpThumb->src . ') succeeded' . ($error ? ' with messsages: "' . $error . '"' : ''), __FILE__, __LINE__);
        $phpThumb->DebugMessage('Setting source data from URL "' . $phpThumb->src . '"', __FILE__, __LINE__);
        $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
    } else {
        $phpThumb->ErrorImage($error);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '7') {
開發者ID:CrazyBobik,項目名稱:allotaxi.test,代碼行數:31,代碼來源:phpThumb.php

示例2: ImageAlphaBlending

            $phpThumb->setParameter('is_alpha', true);
            ImageAlphaBlending($phpThumb->gdimg_source, false);
            ImageSaveAlpha($phpThumb->gdimg_source, true);
        }
        $new_background_color = phpthumb_functions::ImageHexColorAllocate($phpThumb->gdimg_source, $bghexcolor, false, $alpha);
        ImageFilledRectangle($phpThumb->gdimg_source, 0, 0, $phpThumb->w, $phpThumb->h, $new_background_color);
    } else {
        $phpThumb->ErrorImage('failed to create "new" image (' . $phpThumb->w . 'x' . $phpThumb->h . ')');
    }
} elseif (!$phpThumb->src) {
    $phpThumb->ErrorImage('Usage: ' . $_SERVER['PHP_SELF'] . '?src=/path/and/filename.jpg' . "\n" . 'read Usage comments for details');
} elseif (eregi('^(f|ht)tp\\://', $phpThumb->src)) {
    if ($phpThumb->config_http_user_agent) {
        ini_set('user_agent', $phpThumb->config_http_user_agent);
    }
    if ($rawImageData = phpthumb_functions::SafeURLread(phpthumb_functions::CleanUpURLencoding($phpThumb->src), $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) {
        $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
    } else {
        $phpThumb->ErrorImage($error);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '7') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
$phpThumb->GenerateThumbnail();
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
開發者ID:myindexlike,項目名稱:MODX.snippets,代碼行數:31,代碼來源:phpThumb.php


注:本文中的phpthumb_functions::CleanUpURLencoding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。