Erstellt ein Vorschaubild auf Basis eines vorhandenen Bildes
Diese Funktion erstellt auf Basis eines vorhandenen Bildes eine kleinere Vorschauversion.
<?php
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, 120, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, NULL, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', NULL, 120, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
print '<br/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, 120, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, NULL, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', NULL, 120, 'embed');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
?>
<?php
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, 120, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, NULL, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', NULL, 120, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
print '<br/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, 120, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, NULL, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', NULL, 120, 'crop');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
?>
<?php
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, 120, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', 120, NULL, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-rot.png', NULL, 120, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
print '<br/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, 120, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', 120, NULL, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/bild-blau-s.png', NULL, 120, 'default');
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
?>
<?php
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 10));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 40));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 60));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
print '<br />';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 80));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 90));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 120, 120, 'default', array('quality' => 100));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'" />';
?>
<?php
$pathThumbnail = wThumbnail::createThumbnail('/devAssets/img/CIMG1299.jpg', 300, null, 'default', array('extension' => 'webp'));
print '<img style="margin:8px;background-color:#f0f0f0" src="'.$pathThumbnail.'"/>';
?>
Hinweis
Beim Einsatz von Framework-Funktionen in eigenen Skripten beachten Sie bitte den Artikel "So verwenden Sie das PHP-Framework in eigenen Scripten".
Wenn Sie eine Funktion innerhalb einer Weblication® Seite z.B. über das PHP-Quelltext Element oder in einem XSL-Template über wsl:php einbinden, muss das Framework über die grid.php nicht mehr referenziert werden.