{ "sourceImg": { "src": "assets/image.png", "width": 1440, "height": 900, "source": 6 }, "crop": { "width": 800, "height": 600, "x": 560, "y": 134 }, "targetWidth": 800, "targetHeight": 600, "altTag": "This is an alt tag." }
$imageJson = json_decode('{the JSON string: above}'); $options .= "w={$imageJson->targetWidth}&h={$imageJson->targetHeight}&sx={$imageJson->crop->x}&sy={$imageJson->crop->y}"; $output .= $modx->getChunk('renderPrimaryContentImage', array( 'input' => '/../../domain/web/public-assets/img/'.$imageJson->sourceImg->src, 'options' => $options, 'debug' => 'true', ) );
[[!pthumb? &input=`[[+input]]` &options=`[[+options]]` &debug=`1`]]
This question has been answered by Jako. See the first response.
[[ImagePlus? &tvname=`whateverTV` &docid=`[[+id]]` &options=`w=100` ]]
[[ImagePlus? &tvname=`whateverTV` &docid=`[[+id]]` &options=`w=100` &type=`tpl` &tpl=`whateverImagePlusTemplate` ]]
$modx->runSnippet('ImagePlus', array('value' => $yourJsonString, 'type' => 'tpl', 'tpl' => 'yourImageChunkTemplate.chunk.html'))
<img src="[[+url]]" />