当前位置: 首页>>代码示例>>PHP>>正文


PHP Image::getSize方法代码示例

本文整理汇总了PHP中Image::getSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::getSize方法的具体用法?PHP Image::getSize怎么用?PHP Image::getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Image的用法示例。


在下文中一共展示了Image::getSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHTMLNodeInner

 /**
  * Get the html node for this element
  *
  * @param \DOMElement $node
  * @param \AppShed\Remote\XML\DOMDocument $xml
  * @param \AppShed\Remote\HTML\Settings $settings
  */
 protected function getHTMLNodeInner($node, $xml, $settings)
 {
     if ($this->image) {
         $imageDiv = $xml->createElement('div', ['class' => 'image-container']);
         $node->appendChild($imageDiv);
         $imageDiv->appendChild($xml->createImgElement($this->image->getUrl(), 'image', $this->image->getSize()));
     }
     parent::getHTMLNodeInner($node, $xml, $settings);
 }
开发者ID:appshed,项目名称:extension-api,代码行数:16,代码来源:Thumb.php

示例2: hookHome

 function hookHome($params)
 {
     global $smarty;
     $products = Product::getNewProducts((int) $params['cookie']->id_lang, 0, 5);
     $smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home')));
     return $this->display(__FILE__, 'blocknewestproducts.tpl');
 }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:7,代码来源:blocknewestproducts.php

示例3: hookRightColumn

 function hookRightColumn($params)
 {
     global $smarty, $category_path;
     $category_path_ids = array();
     foreach ($category_path as $cat) {
         $category_path_ids[] = $cat['id_category'];
     }
     $currency = new Currency(intval($params['cookie']->id_currency));
     $bestsellers = ProductSale::getBestSalesLight(intval($params['cookie']->id_lang), 0, 25);
     $best_sellers = array();
     $nr = 0;
     foreach ($bestsellers as $bestseller) {
         if ($nr >= 5) {
             break;
         }
         $display = false;
         foreach (Product::getIndexedCategories($bestseller['id_product']) as $row) {
             if (in_array($row['id_category'], $category_path_ids)) {
                 $display = true;
                 break;
             }
         }
         if ($display) {
             $bestseller['price'] = Tools::displayPrice(Product::getPriceStaticLC(intval($bestseller['id_product'])), $currency, false, false);
             $best_sellers[] = $bestseller;
             $nr += 1;
         }
     }
     $smarty->assign(array('best_sellers' => $best_sellers, 'mediumSize' => Image::getSize('medium'), 'static_token' => Tools::getToken(false)));
     return $this->display(__FILE__, 'blockbestsellers.tpl');
 }
开发者ID:redb,项目名称:prestashop,代码行数:31,代码来源:blockbestsellers.php

示例4: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     // Override default configuration values: cause the new products page must display latest products first.
     if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby')) {
         $this->orderBy = 'date_add';
         $this->orderWay = 'DESC';
     }
     $nbProducts = (int) Product::getNewProducts($this->context->language->id, null, null, true);
     $this->pagination($nbProducts);
     $products = Product::getNewProducts($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay);
     $this->addColorsToProductList($products);
     $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displayLeftColumn'), 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int) $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     if ($this->ajax) {
         $product_list = $this->context->smarty->fetch(_PS_THEME_DIR_ . 'product-list.tpl');
         $pagination = $this->context->smarty->fetch(_PS_THEME_DIR_ . 'pagination.tpl');
         $nbLeftProducts = $nbProducts - ($this->n * ($this->p - 1) + count($products));
         $nbLeftProductsPercentage = ($nbProducts - $nbLeftProducts) / $nbProducts * 100;
         echo Tools::jsonEncode(array('productList' => utf8_encode($product_list), 'pagination' => $pagination, 'nbRenderedProducts' => $nbProducts, 'nbLeftProducts' => $nbLeftProducts, 'nbLeftProductsPercentage' => $nbLeftProductsPercentage));
         die;
     } else {
         $this->setTemplate(_PS_THEME_DIR_ . 'new-products.tpl');
     }
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:29,代码来源:NewProductsController.php

示例5: process

 public function process()
 {
     if ($id_supplier = Tools::getValue('id_supplier')) {
         $this->supplier = new Supplier((int) $id_supplier, self::$cookie->id_lang);
         if (Validate::isLoadedObject($this->supplier) and $this->supplier->active) {
             $nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
             $this->pagination((int) $nbProducts);
             self::$smarty->assign(array('nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($id_supplier, (int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay), 'path' => $this->supplier->active ? Tools::safeOutput($this->supplier->name) : '', 'supplier' => $this->supplier));
         } else {
             header('HTTP/1.1 404 Not Found');
             header('Status: 404 Not Found');
             $this->errors[] = Tools::displayError('Supplier does not exist');
         }
     } else {
         if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true);
             $nbProducts = count($data);
             $this->pagination($nbProducts);
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true, $this->p, $this->n);
             $imgDir = _PS_MANU_IMG_DIR_;
             foreach ($data as &$item) {
                 $item['image'] = !file_exists($imgDir . '/' . $item['id_supplier'] . '-medium.jpg') ? Language::getIsoById((int) self::$cookie->id_lang) . '-default' : $item['id_supplier'];
             }
             self::$smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize('medium'), 'suppliers' => $data, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')));
         } else {
             self::$smarty->assign('nbSuppliers', 0);
         }
     }
 }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:29,代码来源:SupplierController.php

示例6: process

 public function process()
 {
     $this->productSort();
     $nbProducts = (int) ProductSale::getNbSales();
     $this->pagination($nbProducts);
     self::$smarty->assign(array('products' => ProductSale::getBestSales((int) self::$cookie->id_lang, (int) $this->p - 1, (int) $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home')));
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:7,代码来源:BestSalesController.php

示例7: __construct

 public function __construct()
 {
     $this->name = 'flexiblebrands';
     $this->imageHomeSize = Image::getSize(ImageType::getFormatedName('home'));
     $this->orderValue = array('sales' => $this->l('Sales'), 'price' => $this->l('Price'), 'discount' => $this->l('Discount'), 'add' => $this->l('Add Date'), 'rand' => $this->l('Random'));
     $this->orderType = array('asc' => $this->l('Ascending'), 'desc' => $this->l('Descending'));
     $this->display = array('all' => $this->l('All'), 'condition-new' => $this->l('New'), 'condition-used' => $this->l('Used'), 'condition-refurbished' => $this->l('Refurbished'));
     $this->groupType = array('auto' => $this->l('Auto'), 'manual' => $this->l('Manual'));
     $this->moduleLayout = array('default' => $this->l('Layout [default]'));
     $this->tempPath = dirname(__FILE__) . '/images/temps/';
     $this->bannerPath = dirname(__FILE__) . '/images/banners/';
     $this->iconPath = dirname(__FILE__) . '/images/icons/';
     if (Configuration::get('PS_SSL_ENABLED')) {
         $this->livePath = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'modules/flexiblebrands/images/';
     } else {
         $this->livePath = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/flexiblebrands/images/';
     }
     $this->secure_key = Tools::encrypt('ovic-' . $this->name);
     $this->tab = 'front_office_features';
     $this->version = '1.0';
     $this->author = 'OvicSoft [SonNC]';
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('Ovic Flexible Brands Module');
     $this->description = $this->l('Ovic Flexible Brands Module');
     $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
     //$this->cache = new FlexibleBrandFastCache();
 }
开发者ID:habypk,项目名称:zocart,代码行数:28,代码来源:flexiblebrands.php

示例8: hookRightColumn

 function hookRightColumn($params)
 {
     global $smarty;
     $newProducts = Product::getNewProducts(intval($params['cookie']->id_lang), 0, intval(Configuration::get('NEW_PRODUCTS_NBR')));
     $smarty->assign(array('new_products' => $newProducts, 'mediumSize' => Image::getSize('medium')));
     return $this->display(__FILE__, 'blocknewproducts.tpl');
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:7,代码来源:blocknewproducts.php

示例9: initContent

 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     // Override default configuration values: cause the new products page must display latest products first.
     if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby')) {
         $this->orderBy = 'date_add';
         $this->orderWay = 'DESC';
     }
     $nb_products = (int) Product::getNewProducts($this->context->language->id, isset($this->p) ? (int) $this->p - 1 : null, isset($this->n) ? (int) $this->n : null, true);
     $this->pagination($nb_products);
     $products = Product::getNewProducts($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay);
     $this->addColorsToProductList($products);
     /************************* /Images Array ******************************/
     if (method_exists('Product', 'getProductsImgs')) {
         $image_array = array();
         for ($i = 0; $i < $nb_products; $i++) {
             if (isset($products[$i]['id_product'])) {
                 $image_array[$products[$i]['id_product']] = Product::getProductsImgs($products[$i]['id_product']);
             }
         }
         $this->context->smarty->assign('productimg', (isset($image_array) and $image_array) ? $image_array : NULL);
     }
     /************************* /Images Array ******************************/
     $this->context->smarty->assign(array('products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int) $nb_products, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'new-products.tpl');
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:27,代码来源:NewProductsController.php

示例10: __construct

 public function __construct()
 {
     $this->name = 'groupcategory';
     //$this->cache = new GroupCategoryFastCache();
     $this->arrType = array('saller' => $this->l('Best Sellers'), 'view' => $this->l('Most View'), 'special' => $this->l('Specials'), 'arrival' => $this->l('New Arrivals'));
     $this->secure_key = Tools::encrypt('ovic-soft[group-category]' . $this->name);
     $this->imageHomeSize = Image::getSize(ImageType::getFormatedName('home'));
     $this->arrLayout = array('default' => $this->l('Layout [default]'));
     $this->pathTemp = dirname(__FILE__) . '/images/temps/';
     $this->pathBanner = dirname(__FILE__) . '/images/banners/';
     $this->pathIcon = dirname(__FILE__) . '/images/icons/';
     if (Configuration::get('PS_SSL_ENABLED')) {
         $this->livePath = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'modules/groupcategory/images/';
     } else {
         $this->livePath = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/groupcategory/images/';
     }
     $this->tab = 'front_office_features';
     $this->version = '1.0';
     $this->author = 'OvicSoft';
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('Supershop - Group Category Module');
     $this->description = $this->l('Group Category Module');
     $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
 }
开发者ID:abdoumej,项目名称:libsamy,代码行数:25,代码来源:groupcategory-d09415.php

示例11: initContent

 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::initContent();
         $this->productSort();
         $nb_products = (int) ProductSale::getNbSales();
         $this->pagination($nb_products);
         if (!Tools::getValue('orderby')) {
             $this->orderBy = 'sales';
         }
         $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
         $this->addColorsToProductList($products);
         /************************* /Images Array ******************************/
         if (method_exists('Product', 'getProductsImgs')) {
             $image_array = array();
             for ($i = 0; $i < $nb_products; $i++) {
                 if (isset($products[$i]['id_product'])) {
                     $image_array[$products[$i]['id_product']] = Product::getProductsImgs($products[$i]['id_product']);
                 }
             }
             $this->context->smarty->assign('productimg', (isset($image_array) and $image_array) ? $image_array : NULL);
         }
         /************************* /Images Array ******************************/
         $this->context->smarty->assign(array('products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nb_products, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
         $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:29,代码来源:BestSalesController.php

示例12: image

 public function image()
 {
     $image = new Image('http://sinastorage.com/sandbox/test.jpg');
     $image->rotate(50);
     $s3 = new S3();
     $result = $s3->plainWrite('test.jpg', $image->getContent(), $image->getSize(), $image->getMimeType());
     Common::debug($result);
 }
开发者ID:guojianing,项目名称:dagger2,代码行数:8,代码来源:DefaultController.php

示例13: hookRightColumn

 function hookRightColumn($params)
 {
     global $smarty;
     if ($special = Product::getRandomSpecial(intval($params['cookie']->id_lang))) {
         $smarty->assign(array('special' => $special, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'] / (1 + $special['rate'] / 100), 2), 'oldPrice' => $special['price'] + $special['reduction'], 'mediumSize' => Image::getSize('medium')));
     }
     return $this->display(__FILE__, 'blockspecials.tpl');
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:8,代码来源:blockspecials.php

示例14: process

 public function process()
 {
     parent::process();
     $this->productSort();
     $nbProducts = Product::getPricesDrop((int) self::$cookie->id_lang, NULL, NULL, true);
     $this->pagination($nbProducts);
     self::$smarty->assign(array('products' => Product::getPricesDrop((int) self::$cookie->id_lang, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home')));
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:8,代码来源:PricesDropController.php

示例15: hookDisplayHome

 public function hookDisplayHome($params)
 {
     $categoryRoot = new Category(Configuration::get('PS_HOME_CATEGORY'), $this->context->language->id, $this->context->shop->id);
     $categoriesHome = $categoryRoot->getSubCategoriesMatrassHome($this->context->language->id);
     //функция описана в classes Category.php
     $this->smarty->assign(array('subcategories' => $categoriesHome, 'homeSize' => Image::getSize('medium_default')));
     return $this->display(__FILE__, 'blockhomecategorys.tpl');
 }
开发者ID:Beattle,项目名称:perrino-shop,代码行数:8,代码来源:blockhomecategorys.php


注:本文中的Image::getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。