Hallo,
ich habe eine kleines Modul umgewandelt, dass in Joomla 3 die Class Joomla\Image\Image; nutzt
PHP
<?php
defined('_JEXEC') or die;
//get latest article from specitic catid
$catid = '182'; // your category-id
$db = JFactory::getDbo();
$db->setQuery('SELECT id, title, images FROM #__content WHERE catid = '.$catid.' ORDER BY created DESC LIMIT 1');
$result = $db->loadAssoc();
$link = 'index.php?option=com_content&view=article&id=' . $result['id'];
$link .= '&catid=' . $catid;
//$link .= '&lang=' . $language;
?>
<?php $images1 = json_decode($result['images']); ?>
<?php use Joomla\Image\Image; ?>
<?php $i = 0; ?>
<?php foreach ($list as $item) :?>
<?php $images = json_decode($item->images); ?>
<?php // This checks the Intro Image exists and isn't empty. ?>
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<?php endif; ?>
<?php //exists Image
$filename = JPATH_ROOT . '/crop'.'/'.$images->image_intro;
if (file_exists($filename)) {
}
else {
$image = new Image(JPATH_ROOT . '/'.$images->image_intro);
// Crop the image to 150px square, starting 10 pixels from the left, and 20 pixels from the top
$image_resized = $image->cropResize(120, 120);
// Write it to disk
$image_resized->toFile(JPATH_ROOT . '/crop'.'/'.$images->image_intro, IMAGETYPE_JPEG, array('quality' => 74));
}
?>
Alles anzeigen
Die scheint es in Joomla 4 nicht mehr zu geben. Was kann ich denn stattdessen nutzen?
Weiß da jemand was?