本文整理匯總了PHP中ImageManager::fileDestManagement方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::fileDestManagement方法的具體用法?PHP ImageManager::fileDestManagement怎麽用?PHP ImageManager::fileDestManagement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageManager
的用法示例。
在下文中一共展示了ImageManager::fileDestManagement方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Produit
// ------------------------------------------------------------------------ //
// ---- Gestion des produits --------------------------------------------- //
if ( $_POST[ "mon_action" ] == "gerer" ) {
$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 );
示例2: foreach
// ---------------------------------------------- //
// ---- Traitement des données ------------------ //
if (1 == 1) {
$id = $produit->gererDonnees($_POST, $debug);
}
// ---------------------------------------------- //
// ---- Gestion des images du produit -------------------------------- //
if (!empty($_POST["mes_images"])) {
//print_pre( $_POST[ "mes_images" ] );
$cpt = 1;
foreach ($_POST["mes_images"] as $_image) {
$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>";