While this is not directly related to DC, it does affect DC users which is why I'm posting it here.
For every product I have various different sizes in the same colour (up to 15 in fact). Every time I upload an image, Drupal creates a new file ie image.jpg, image_0.jpg, image_1.jpg, image_2.jpg etc.
As my database has over 10000 individual products in it, this is amounting to a lot of excess files that aren't needed. happening?
It happens when I import the products with Commerce Feeds and it also happens when I enter a product directly. It also happens whether I choose a file from a different directory or the directory where the image files are kept. It seems to be the normal behavior for add one image to multiple nodes.
Is there a way to stop this from happening?
Comments
Comment #1
rszrama commentedRight now, I think you have two options:
1) If you don't need different images per product, you can just put the images on the product display nodes instead of the products themselves.
2) If you do, there may be a way for you to use a Media module that can reuse the same image in multiple places. Not sure about that, though.
Comment #2
dudenhofer commentedThere might be an option with http://drupal.org/project/entityreference
1) Create a content type of Image, with just the title and imagefield.
2) Create nodes for each of your images. I was using titles like "Tshirt (black)"
3) Install the module above
4) Edit your product and add an Entity Reference field, to select your Image Node type. Notice the readme recommends using the autocomplete if you have a lot of options (instead of the select widget)
5) Edit the Product Display's display settings. I set the Entity Field to Full Node (and hid the title), but you could create your own view mode to better control how it's displayed.
This way you can reference the same image across multiple products. Maybe that could be an approach to take?
Comment #3
dudenhofer commentedAlso thought I would mention that you could use this module as well to reference a single file in multiple nodes
http://drupal.org/project/filefield_sources
It might be less work than the recipe above.
Comment #4
ssherriff commentedHi, has this issue been solved or looked again again since 2012? I could be missing something, but it seems like it is still required to make the choice between having all the same images for product variations, or having to upload images for every variation even if they are something like 'size' which normally doesn't need a new image.
For example, a fairly common situation would be a product with a few colors and sizes. When choosing a new color, you'd want to maybe change the images, but when choosing a new size, you want the image to be determined by the color selected.
Am I possibly missing a solution that has been developed since this original issue was posted, or is this still an issue? I'd be surprised, because this would be a common capability of e-commerce solutions, so seems like someone must have at least started a module if the Commerce team hasn't started anything. It just seems like this is a severe usability issue which is why I believe I must have missed something.
Thanks for any help that can be provided.
Cheers,
Steph
Comment #5
bojanz commentedClosing old support request. Commerce can't solve image reuse, that's a general Drupal problem, and general solutions (Media, Filefield sources) have been mentioned here. People have been using them for the past 7 years, which is why no other solutions have been developed.