PHP code example of monsieurbiz / mbiz_imagecrop

1. Go to this page and download the library: Download monsieurbiz/mbiz_imagecrop 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/ */

    

monsieurbiz / mbiz_imagecrop example snippets



$width = 100; // onal argument
$imagePath = 'foo/bar.png'; // Your image is in the /media directory. In /media/foo/ precisely.

// The method of the helper
// crop($imageRelativePath, $width, $height = null);

$imageUrl = Mage::helper('mbiz_imagecrop')->crop($imagePath, $width, $height);


$width = 100; // onal argument
$imagePath = 'foo/bar.png'; // Your image is in the /media directory. In /media/foo/ precisely.

// The method of the helper
// resize($imageRelativePath, $width, $height = null);

$imageUrl = Mage::helper('mbiz_imagecrop')->resize($imagePath, $width, $height);


$imageUrl = Mage::helper('mbiz_imagecrop')->setPrefix('baz')->crop($imagePath, $width, $height);


$imageUrl = Mage::helper('mbiz_imagecrop')->setPrefix('baz')->resize($imagePath, $width, $height);