if ($modx->event->name=="OnDocFormSave")
{
$tv = 'image_1';
$tv2 = 'image_1_preview';
$options = 'w=100&h=100&zc=1';
$tvv = $resource->getTVValue($tv);
if (!empty($tvv))
{
$thumbnail = $modx->runSnippet('phpThumbOn', array(
'input' => $tvv,
'options' => 'w=113&h=113&q=70&zc=1',
));
if (!empty($thumbnail)){
$resource->setTVValue($tv2, $thumbnail);
}
}
}