public function reloadImages() { $dir = _TM_PRO_IMG_DIR; $productsImages = Image::getAllImages(); foreach ($productsImages as $k => $image) { $imageObj = new Image($image['id_image']); //echo $dir.$imageObj->getExistingImgPath().'.jpg'; if (file_exists($dir . $imageObj->getExistingImgPath() . '.jpg')) { if (!ImageCore::imageResize($dir . $imageObj->getExistingImgPath() . '.jpg', $dir . $imageObj->getExistingImgPath() . '-' . stripslashes($this->name) . '.jpg', (int) $this->width, (int) $this->height)) { $errors = true; } } } }