Avoiding creation of duplicate images during node image upload

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Kathelijne's picture

Using D7, image cache is enabled

I have a content type "promotions" that contains an image field, among other fields. Users upload an image using the standard "choose file - upload" which comes pre-installed with D7.

However, we often need the same image for multiple promotions. When uploading, Drupal duplicates the image and stores them as

myimage.jpg
myimage_0.jpg
myimage_1.jpg
etc.

even though they're exactly the same image (filesize, name & all)

Is there a way to avoid this duplication and automatically redirect to the first uploaded image to save some space? Or maybe just propose an overwrite?

I've googled around, and have only been able to find this discussion.: http://www.ubercart.org/forum/support/8017/best_way_handle_duplicate_images
it describes the exact same problem but talks about Drupal 5 - promising a fix for it in D6 or D7.

I'm aware (through a similar discussion in this group) that there is some workaround where you also input a link field to the original image and then handle the displayed image conditionally. However, since I need an easy user interface for my client, this seems a bit too complicated. It would require them to copy/paste the image location, or in the very least, check first whether or not the image is already there or not.

Any help is much appreciated! I hope I'm just missing something really obvious...

Comments

media module

ellen.davis's picture

Check out the media module. http://drupal.org/project/media

Once installed, you can change the widget for the file upload to media selector. Using the selector, you can choose images that were uploaded to a previous node.

Image

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: