The product base image (in /images/ or /images/your_subdir/) is the thumbnail: the smallest sized image.
You don't want additional images at thumbnail size, ever - that's what all the work is about, to get medium-sized additional images on the product info page.
The stock ZC code requires a thumbnail-sized image for every product image, main or additional. My mods change that to requiring a medium-sized image for the additional images, and a large image if desired.
----------------------------------------------------------------------
Note: I have just noticed a bug in my code - the large images would need to be named filename_MED_LRG.jpg to work as written. It would be possible to strip the _MED from the base that generates the large filename, but it would be much simpler to eliminate a line of my code and not require the additional images in the /medium/ folder to have _MED in their names.
So... replace the first new code block in post 32 withName your additional images likePHP Code:$products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
if ($products_image_directory != '') { //med add: product is in a subdir - insert medium/ into dir path
$products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
$products_image_directory_medium = DIR_WS_IMAGES . 'medium/' . str_replace($products_image_directory, '', $products_image) . "/";
} else { //med add: product is in /images/ - insert medium/ into dir path
$products_image_directory = DIR_WS_IMAGES;
$products_image_directory_medium = DIR_WS_IMAGES . 'medium/';
}
// Check for additional matching images
$file_extension = $products_image_extension;
$products_image_match_array = array();
if ($dir = @dir($products_image_directory_medium)) { //med add: if med is valid dir
while ($file = $dir->read()) {
if (!is_dir($products_image_directory_medium . $file)) { //med add: if item being read is file, not subdir
if (substr($file, strrpos($file, '.')) == $file_extension) {
// if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
if(preg_match("/" . $products_image_base . "/i", $file) == '1') {
if ($file != (str_replace($products_image_extension, '', $products_image) . IMAGE_SUFFIX_MEDIUM . $products_image_extension)) { //med add: check against main med img, not main thumb
if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {//med add: filename must not end in _MED, to ease large file use
// echo 'I AM A MATCH ' . $file . '<br>';
$images_array[] = $file;
} else {
// echo 'I AM NOT A MATCH ' . $file . '<br>';
}
filename_01.jpg, and save in
/images/medium/your_subdir/ .
----------------------------------------------------------------------
We have both spent a lot of time trying to describe what we think code may or may not do; it would save a lot of energy if you try the code and see what it does. If it doesn't work, I'll troubleshoot it. Save a copy of the original file (it should still be there at /includes/modules/additional_images.php) so if something goes wrong with /includes/modules/your_template/additional_images.php you can easily recover. This is standard procedure.



