Jump to content

To many images!


Kalarah

Recommended Posts

I have now inputted 100 products in my CC. There is now an issue. When uploading an image and using it for the product, CC creates 9 additional images. Why? This is simply too many. I know they are all of different sizes, and I think they are being used for specific screen widths for @media in the CSS. Anyone whows knows responsive design knows to use box-sizing like so:

*,
*:after,
*:before {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
             box-sizing: border-box }

And also:

img {
	-ms-interpolation-mode: bicubic;
	border-style: none;
	vertical-align: top;
	max-width: 100%;
	height: auto; }

So I'm asking, how do we stop CC from creating so many useless images? And also, another annoying thing. If you delete a product, it does not delete the images with it so we are left with a trove of images not being used and taking up space.

Link to comment
Share on other sites

because that is what your store skin is configured to use in it's config file. CC will build cached versions of all sizes your skin needs so it doesn't have to build / process images on the fly, which is a very memory and CPU intensive process. Doing it once and caching the result is effecient.  They are not useless, they are required. If you don't want them, remove them from your skin config file.

I will be releasing a module to clean up unused images, should be out in a couple of months.

Link to comment
Share on other sites

CubeCart is following the dictates of the skin. In the named skin folder, a config.xml file states the various sizes of the images it has required in its design. The various sizes are keyed to reference words and CubeCart uses the reference words to create a URL for the page resource.

You have a valid point: have just one 800x600 image and let the browser use it everywhere, having the browser scale to fit CSS or HTML size declarations.

If you wish to experiment, in the skin's config.xml file, change all the reference image sizes to have the same maximum=800 (and be sure to upload at least that size image). Then, CubeCart will only make one rendered image.

In past stores (CC3 which has a different process), I had the need to create a distinctly unique smaller version of the main image - that is, not being a simple resizing to a smaller version of the same image. Therefore, for others having a similar requirement, 'pre-loading' the image cache with an externally derived set of main images coincides with the skin's references.

The product to image relationship is a "many to many". While much of the time, one image depicts one product, that is not always the case. One can assign the same image to many different products, and also assign many images (one image is the main image, the rest appear in a gallery) to one product. Given that capability, deleting images must be a manual effort.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...