Hi....
To use it for thumbnail and normal with different crop you can edit your ItemAction
this is my code, but maybe it already has to much modification:
public function uploadItemResources($aResources,$itemId)
{
if($aResources != '') {
$itemResourceManager = ItemResource::newInstance();
$folder = osc_images_path().floor($itemId/1000000)."/".sprintf("%02d", floor(($itemId%1000000)/10000))."/".sprintf("%02d", floor(($itemId%10000)/100))."/";
$numImagesItems = osc_max_images_per_item();
$numImages = $itemResourceManager->countResources($itemId);
foreach ($aResources['error'] as $key => $error) {
if($numImagesItems==0 || ($numImagesItems>0 && $numImages<$numImagesItems)) {
if ($error == UPLOAD_ERR_OK) {
$tmpName = $aResources['tmp_name'][$key];
$imgres = ImageResizer::fromFile($tmpName);
//$extension = osc_apply_filter('upload_image_extension', $imgres->getExt());
//$mime = osc_apply_filter('upload_image_mime', $imgres->getMime());
$extension ='jpg';
$mime = 'image/jpeg';
// Create normal size
$normal_path = $path = $tmpName."_normal";
$size = explode('x', osc_normal_dimensions());
$img = ImageResizer::fromFile($tmpName)->autoRotate()->resizeTo($size[0], $size[1], false);
if( osc_is_watermark_text() ) {
$img->doWatermarkText(osc_watermark_text(), osc_watermark_text_color());
} elseif ( osc_is_watermark_image() ){
$img->doWatermarkImage();
}
$img->saveToFile($path, $extension);
// Create preview
$path = $tmpName."_preview";
$size = explode('x', osc_preview_dimensions());
ImageResizer::fromFile($tmpName)->autoRotate()->resizeTo($size[0], $size[1], true)->saveToFile($path, $extension);
// Create thumbnail
$path = $tmpName."_thumbnail";
$size = explode('x', osc_thumbnail_dimensions());
ImageResizer::fromFile($tmpName)->autoRotate()->resizeTo($size[0], $size[1], true )->saveToFile($path, $extension);