$extension = pathinfo($result['image'], PATHINFO_EXTENSION);
$image_old = $result['image'];
$image_new = 'cache/' . utf8_substr($result['image'], 0, utf8_strrpos($result['image'], '.')) . '-' . (int)$this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width') . 'x' . (int)$this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height') . '.' . $extension;
if (!is_file(DIR_IMAGE . $image_new) || (filemtime(DIR_IMAGE . $image_old) > filemtime(DIR_IMAGE . $image_new)) {
$image = new Image(DIR_IMAGE . $image_old);
if ($image) {
$image->resize($this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));
$image->rotate(90);
$image->save(DIR_IMAGE . $image_new);
}
}
if (is_file(DIR_IMAGE . $image_new)) {
$image = ($this->request->server['HTTPS'] ? $this->config->get('config_ssl') : $this->config->get('config_url')) . 'image/' . $image_new;
} else {
$image = $this->model_tool_image->resize('no_image.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));
}