PHP code example of adevendorf / craft-pretzelimage

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

    

adevendorf / craft-pretzelimage example snippets


craft.pretzel.url(asset, { width: 100, height: 50 }, { position: asset.getFocalPoint() });

use adevendorf\pretzelimage\Plugin;

$asset = $entry->image->one();
$image = Plugin::$plugin->pretzelService->url($asset, [
  'width' => 600, 'height' => 360, 'position' => $asset->getFocalPoint()
]);