1. Problem: $objBild ist leer bei diesem Vorgehen
PHP-Code:
$objFile = \FilesModel::findByUuid($defaultImage);
$objBild = new \stdClass();
\Controller::addImageToTemplate($objBild, $objFile->row(), null, null, $objFile);
print_r auf $objFile->row():
Code:
Array
(
[id] => 55
[pid] => ?`?S?????,p?
[tstamp] => 1592331967
[uuid] => ? ???????
[type] => file
[path] => files/demo/Kujawa_05_2020_10.jpg
[extension] => jpg
[hash] => cc3cb6350d374b02b5662d346476c107
[found] => 1
[name] => Kujawa_05_2020_10.jpg
[importantPartX] => 0
[importantPartY] => 0
[importantPartWidth] => 0
[importantPartHeight] => 0
[meta] =>
)
print_r auf $objBild (wird in der Variable image gespeichert und bleibt leider leer):
Code:
[image] => stdClass Object
(
[width] =>
[height] =>
[picture] => Array
(
[img] => Array
(
[src] =>
[srcset] =>
)
[sources] => Array
(
)
[alt] =>
[title] =>
)
[alt] =>
[caption] =>
[imageTitle] =>
[imageUrl] =>
[src] =>
[singleSRC] =>
[linkTitle] =>
[fullsize] =>
[addBefore] => 1
[margin] =>
[addImage] => 1
)
\Controller::addImageToTemplate macht also offensichtlich nichts mit $objFile->row(). Wo ist der Fehler?
2. Problem: Wie bekomme ich die Bildgrößen da mit rein? In meinem Fall z.B. liegt die Bildgröße als serialisiertes Array vor:
Code:
a:3:{i:0;s:0:"";i:1;s:0:"";i:2;s:1:"4";}
Es handelt sich hier um eine vordefinierte Bildgröße mit der ID 4 (Author 120x145).
Lesezeichen