PHP code example of dbashyal / magento_resize_category_images

1. Go to this page and download the library: Download dbashyal/magento_resize_category_images library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dbashyal / magento_resize_category_images example snippets


<img src=" 
	echo $this->helper('timage')
			  ->init($_category->getImageUrl())
			  ->setWidth(230)
			  ->setHeight(200)
			  ->crop()
			  ->resize() 
	

<img src=" 
	echo $this->helper('timage')
			  ->setRemoveHttp(false)
			  ->init($_category->getImageUrl())
			  ->setWidth(230)
			  ->setHeight(200)
			  ->crop()
			  ->resize() 
	

Mage::helper('timage')
                ->init(Mage::getBaseUrl('media') . 'catalog/product' . $product['giftcard_image'])
                ->setWidth(780)
                ->setHeight(505)
                ->keepFilename(true)
                ->keepAspectRatio(false)
                ->setDeveloperMode(true)
                ->crop(280, 10, 10, 280)
                ->resize();

Mage::helper('timage')
            ->init(Mage::getBaseUrl('media') . 'catalog/product' . $image)
            ->setWidth(120)
            ->setHeight(25)
            //->keepFilename(true)
            //->keepAspectRatio(true)
            //->setDeveloperMode(true)
            ->centerCrop()
            ->resize();
 echo $_category->getURL() 
 echo $this->htmlEscape($_category->getName()) 
 echo $this->helper('timage')->init($_category->getImageUrl())->resize(null, 120) 
 echo $this->htmlEscape($_category->getName())