and same code is in line 934
foreach ($mainResolutions as $k=>$v)
{
$width = $v["width"];
$height = $v["height"];
if ($arr_fileData[0]<$width) continue;
if (abs($ratio - number_format($width/$height,2))>0) continue;
$thumbnailPath = WALLPAPERS_PATH.$file_prefix.URL_TOKEN_SEPARATOR.$width."x".$height.".jpg";
@unlink($thumbnailPath);
if (GENERATE_IMAGES_UPLOAD==1)
{
$forceResize = false;
if (abs($ratio - number_format($width/$height,2))>0) $forceResize = true;
$resizer = new Thumbnail($fullsizePath);
if(isset($resizer->invalid))
{
$siteError->add($LANG->l('Error upload resize for %s', array('p1' => $sourceFile)),"error");
return false;
//redirect();
}
$resizerOut = $resizer->resize($width, $height, $width, $height, "#FFFFFF", $forceResize);
if ($resizerOut!==false)
$resizer->save($thumbnailPath);
else
{
$siteError->add($LANG->l('Error resize process for %s', array('p1' => $sourceFile)),"error");
return false;
}
unset($resizer);
}
$sql = "INSERT INTO
.
SET
e
='".$photoId."',
s
='".$v["id"]."'";
$DB->query($sql);
if ($v['category']=="Wide") $is_wide = 1;
if ($v['category']=="HD") $is_hd = 1;
}