The biggest problem with osCommerce version 2 is that all images, whether for products, categories, manufacturers or built into osCommerce are stored in one huge folder which means newly uploaded images can overwrite other completely unrelated images if they happen to have the same file name as a previously loaded image. This contribution splits the images for categories, products and manufacturers into their own folders (as is done in osCommerce version 3) which gives protection against overwriting the stock osCommerce images. An unlimited number images can still be added to a product and each product gets its own folder for images (which is NOT done in osCommerce 3, at least as of alpha 5) which protects against the image of one product overwriting the image of another unrelated product if the file name for the image happens to be the same.
Category and manufacturer images that are larger than the sizes defined in admin image configuration (Subcategory Image width and height) are resized down to fit and are protected from overwriting other category or manufacturer images by renaming the files to a unique name for each category and manufacturer. Thumbnail images are created to fit the admin configuration for Small Image width and height for products to conserve download bandwidth for product listings. Uploaded images are first sent to a temporary folder and are then moved to final position only if the edit/create of a category, manufacturer or product is confirmed. This makes orphaned images that are left over because an edit was cancelled after an image was uploaded easy to find. Provision is also made for products to display a language determined "No Image Available" image or no image at all if the product is not a physical product. Also added are configuration variables to determine the maximum size of original images to allow (those that are too large will automatically be resized down) and one to set the size of images to display on the product information page.
This contribution ensures that uploaded image files are of a type that can be used by all browsers (i.e. GIF, JPEG or PNG) and prevents another type of file from being uploaded even if it has been renamed with a valid image extension. The upload manager is also updated to reject file names that contain characters that can cause problems on some systems but not others. Characters not allowed for both Linux/Mac and Windows file names are rejected.
All original images are now retained so that smaller images can be recreated at any time using the Image Manager utility included with this contribution should you ever decide to change the thumbnail or large product image sizes. Thumbnail images are now padded to fit the set size with the image centered to provide a consistent look throughout the online catalog. Large product images are also padded with the image centered to fit the large product size. This prevents the Jquery thumbnail display on the product info page from looking messy when there is more than one row of thumbnails and the images for the product are not all the same size.
Entry of an image strictly for product listings that the user has to size manually has been eliminated and instead the thumbnail created for the first product image in the sort order is used. This can be changed at any time by either sorting a different image to be first or by setting a new default image for the product using the Image Manager. The admin product preview has also been changed to match that of the product info page in the catalog.
The Image Manager has become more powerful. While you can still use it to add images to a product (the product entry version for adding images is actually better) the main focus is now checking for image errors such as missing image files or invalid images and then fixing the problems. Image Manager can now load new images for categories and manufacturers and find and fix problems with those files as well. It also can find orphaned files left behind when one image file is used to replace another of a different name.
The thumbnail creation function has been modified to product better looking results from palette based images and now allows padding images to fit a specified size.
Complete install instructions with utility progams enclosed.