hi,
i will admit i am a little late to the image handler party. that said, since i have installed this add-on, i think it's awesome.
now to a small problem i have encountered and i am curious if any one else has this same issue. i am running v155 and IH v4.0 for v1.5.x. and frankly i'm not sure if its related to the image handler and the BMZ cache or part of the base ZC code, but i thought i would present it here. here is the situation:
- product 1 has an image associated with it called image1.jpg
- i now want to change the image for product 1. i have a new image file with the same name of image1.jpg
- i edit the product and select my new image file with the same name. it successfully gets uploaded to my site.
- image1_MED.jpg and image1_LRG.jpg do NOT get deleted. so now those image files remain for the old image.
i have now modified the code in /admin/includes/modules/product/update_product.php to delete those files.
Code:
if ($new_image == 'true') {
$src = DIR_FS_CATALOG . DIR_WS_IMAGES . zen_get_products_image((int)$products_id);
$filename_small = $src;
preg_match("/.*\/(.*)\.(\w*)$/", $src, $fname);
$products_image = zen_get_products_image((int)$products_id);
$products_image_extention = substr($products_image, strrpos($products_image, '.'));
$products_image_base = preg_replace('*' . $products_image_extention . '*', '', $products_image);
$filename_medium = DIR_FS_CATALOG . DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . '.' . $fname[2];
$filename_large = DIR_FS_CATALOG . DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . '.' . $fname[2];
if (file_exists($filename_large)) {
unlink($filename_large);
}
if (file_exists($filename_medium)) {
unlink($filename_medium);
}
}
and frankly, i'm curious if someone else has experienced this problem; or if i did not install this plug-in correctly; or if by deleting those old files at this time, i am bypassing any of the benefits associated with this plugin.
thanks in advance!
Bookmarks