本文整理匯總了PHP中ImageManager::imageResize方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::imageResize方法的具體用法?PHP ImageManager::imageResize怎麽用?PHP ImageManager::imageResize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageManager
的用法示例。
在下文中一共展示了ImageManager::imageResize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Produit
$produit = new Produit();
$imageManager = New ImageManager();
// ---- Traitement de l'image ------------------- //
if ( $_POST[ "url1" ] != '' ) {
$source = $_SERVER[ "DOCUMENT_ROOT" ] . $_POST[ "url1" ];
if ( $debug ) echo "Source : " . $source . "<br>";
if( strstr( $source, 'uploads' ) ) {
$source = $_SERVER[ "DOCUMENT_ROOT" ] . $_POST[ "url1" ];
$filenameDest = $imageManager->fileDestManagement( $source, $_POST[ "id" ] );
// ---- Image -------- //
$destination = $_SERVER[ "DOCUMENT_ROOT" ] . '/photos/produit' . $filenameDest;
if ( $debug ) echo "Destination : " . $destination . "<br>";
$imageManager->imageResize( $source, $destination, 637, null, ZEBRA_IMAGE_CROP_CENTER );
$_POST[ "image" ] = $filenameDest;
}
}
$imageManager = null;
// ---------------------------------------------- //
// ---- Traitement des donn�es ------------------ //
if ( 1 == 1 ) {
$id = $produit->gererDonnees( $_POST, $debug );
}
// ---------------------------------------------- //
// ---- Redirection apr�s traitement ------------ //
if ( 1 == 1 ) {
示例2: Catproduct
}
}
// ----------------------------------------------------------- //
// ---- Traitement des Produits ------------------------------ //
if ($_POST['reference'] == 'product') {
//print_r($_POST);exit();
$catproduct = new Catproduct();
$imageManager = new ImageManager();
for ($i = 1; $i < 4; $i++) {
$source = $_SERVER['DOCUMENT_ROOT'] . $_POST['url' . $i];
if (strstr($source, 'uploads')) {
$source = $_SERVER['DOCUMENT_ROOT'] . $_POST['url' . $i];
$filenameDest = $imageManager->fileDestManagement($source, $_POST['id']);
//Image
$destination = $_SERVER['DOCUMENT_ROOT'] . '/photos/products' . $filenameDest;
$imageManager->imageResize($source, $destination, null, 650);
//Vignette
$destination = $_SERVER['DOCUMENT_ROOT'] . '/photos/products/thumbs' . $filenameDest;
$imageManager->imageResize($source, $destination, null, 250);
$_POST['url' . $i] = $filenameDest;
}
}
if ($_POST['action'] == 'modif') {
//Modifier
try {
$result = $catproduct->productModify($_POST);
$catproduct = null;
header('Location: /admin/product-list.php');
} catch (Exception $e) {
echo 'Erreur contactez votre administrateur <br> :', $e->getMessage(), "\n";
$catproduct = null;
示例3:
$source = $_SERVER['DOCUMENT_ROOT'] . $_image;
if ($debug) {
echo "<br>--- source : " . $source . "<br>";
}
$filenameDest = $imageManager->fileDestManagement($source, $id);
if ($debug) {
echo "--- filenameDest : " . $filenameDest . "<br>";
}
// ---- Création des différentes images ------------ //
if (1 == 1) {
// ---- Image de taille "normale" ---- //
$destination = $_SERVER['DOCUMENT_ROOT'] . '/photos/produit/normale' . $filenameDest;
if ($debug) {
echo "--- destination : " . $destination . "<br>";
}
$imageManager->imageResize($source, $destination, 800, 600, null);
// ---- Image de taille "grande" ----- //
$destination = $_SERVER['DOCUMENT_ROOT'] . '/photos/produit/accueil' . $filenameDest;
if ($debug) {
echo "--- destination : " . $destination . "<br>";
}
$imageManager->imageResize($source, $destination, 319, 327, ZEBRA_IMAGE_CROP_CENTER);
// ---- Image de taille "vignette" --- //
$destination = $_SERVER['DOCUMENT_ROOT'] . '/photos/produit/vignette' . $filenameDest;
if ($debug) {
echo "--- destination : " . $destination . "<br>";
}
$imageManager->imageResize($source, $destination, 97, 99, ZEBRA_IMAGE_CROP_CENTER);
}
// ------------------------------------------------- //
// ---- Ce produit a-t-il une image par défaut? ---- //
示例4:
if ($_POST["mon_action"] == "gerer") {
// ---- Gestion de l'image du tarif ------------------------------- //
if ($_POST["url0"] != '') {
$source = $_SERVER["DOCUMENT_ROOT"] . $_POST["url0"];
if ($debug) {
echo "Source : " . $source . "<br>";
}
if (strstr($source, 'uploads')) {
$source = $_SERVER["DOCUMENT_ROOT"] . $_POST["url0"];
$filenameDest = $imageManager->fileDestManagement($source, $_POST["id"]);
// ---- Image
$destination = $_SERVER["DOCUMENT_ROOT"] . '/photos/tarif' . $filenameDest;
if ($debug) {
echo "Destination : " . $destination . "<br>";
}
$imageManager->imageResize($source, $destination, 221, 221, ZEBRA_IMAGE_CROP_CENTER);
// ---- Vignette
$destination = $_SERVER["DOCUMENT_ROOT"] . '/photos/tarif/thumbs' . $filenameDest;
$imageManager->imageResize($source, $destination, 170, 170, ZEBRA_IMAGE_CROP_CENTER);
$_POST["url0"] = $filenameDest;
}
}
// ---------------------------------------------------------------- //
// ---- Traitement des données ------------------------------------ //
if (1 == 1) {
$id = $tarif->gererDonnees($_POST, $debug);
}
// ---------------------------------------------------------------- //
// ---- Redirection après traitement ------------------------------ //
if (1 == 1) {
$page_redirection = "/admin/tarif/liste.php";
示例5: Categorie
$categorie = new Categorie();
$imageManager = New ImageManager();
// ---- Traitement de l'image ------------------- //
if ( $_POST[ "url1" ] != '' ) {
$source = $_SERVER[ "DOCUMENT_ROOT" ] . $_POST[ "url1" ];
if ( $debug ) echo "Source : " . $source . "<br>";
if( strstr( $source, 'uploads' ) ) {
$source = $_SERVER[ "DOCUMENT_ROOT" ] . $_POST[ "url1" ];
$filenameDest = $imageManager->fileDestManagement( $source, $_POST[ "id" ] );
// ---- Image -------- //
$destination = $_SERVER[ "DOCUMENT_ROOT" ] . '/photos/categorie' . $filenameDest;
if ( $debug ) echo "Destination : " . $destination . "<br>";
$imageManager->imageResize( $source, $destination, 312, 154, ZEBRA_IMAGE_CROP_CENTER );
$_POST[ "image" ] = $filenameDest;
}
}
$imageManager = null;
// ---------------------------------------------- //
// ---- Traitement des données ------------------ //
if ( 1 == 1 ) {
$id = $categorie->gererDonnees( $_POST, $debug );
}
// ---------------------------------------------- //
// ---- Redirection après traitement ------------ //
if ( 1 == 1 ) {