Magento: New Extension Idea – Product Image Removal

As you most likely know, when you remove an image from a product, or delete a product, the image file actually stays in it’s place on the server. It is not removed. Rare is the case when I want the image to remain there if I am removing it from a product, or deleting a product. I would much rather it be deleted!

I’m thinking about writing a module that would allow you to easily enable or disable image deletion in these two cases. So, if you have it enabled, when you remove an image from a product, or delete a product, the image would be fully removed. Simple.

I’d like to try and gauge if Magento users would be interested in such an extension. If this sounds like something you’d be interested in, please comment and let me know. Feel free to add any additional ideas as well.

This entry was posted in Magento. Bookmark the permalink.

14 Responses to Magento: New Extension Idea – Product Image Removal

  1. Bho says:

    How are things coming along with this extension? Are you going to be offering it anytime soon?

  2. key says:

    At first, you should forbid different products use same image and then you can delete everything you like. why don’t let product use remote image.

  3. Janzell says:

    @kamil you have good point… Image Clean must consider that perspective..

  4. I actually already use an extension that does this: Image Clean. Been using it for quite awhile now! :)

    • Josh Pratt says:

      Sherrie – While Image Clean works, it doesn’t do exactly like I plan. That image is a utility to help you clean things up after the fact. It’s an extra step. My module would just remove the image for you. No need for any extra steps.

      • Martin says:

        Sometimes its actually a nice thing that images doesnt get deleted – it could be a mistake a user have deleted the product (maybe the user has made a simple product instead of a configurable)

        What I would suppose is maybe make a cronjob/index service
        which says
        “this product is deleted X (configurable..) hours ago – does it have any images? YES – delete images”.

  5. Kamil says:

    Well, idea looks good.
    Keep in mind that there can be few products with the same image assigned.

    • Josh Pratt says:

      Kamil – Yes, you bring up a good point. I would probably have to build in something to check to see how many products use a particular image. If it is only used once, then remove it, otherwise leave it there. This would be more taxing on the server if you were trying to remove products in mass – but might be a necessary thing to do. Thanks for the feedback.

  6. Dan Shields says:

    You know what would be better is a whole Image Extension Tools. Such as your deleting images option. But also checking for duplicates on the product. for instance if the product has an image assigned to it that is image.jpg but also has image_1.jpg remove the image_1.jpg. This would be really useful for people importing data and running the same import over and over. If some products fail you aren’t sure exactly which ones so you run the import again but this duplicates the images.

    You could also have it check to make sure certain settings like do you want all main images to be excluded from the gallery or other ones like small image or thumbnail so they don’t show up in the more images field.

    Another one could be list all products that don’t have an image assigned to it so you can quickly find those and make sure they have one, you could also add some filtering of rules maybe like is product visible in catalog or catalog and search.

    Those are some of my ideas, obviously if you create the initial one with just deleting the product images that would be good.

    • Josh Pratt says:

      Dan – You bring up a good point. The tough part with duplicate images is though: In some cases, you may want to replace the image, in other cases, you may want it added in addition to what is currently there. But – if there was a setting I guess to always allow overwriting an image (not duplicating it with the _1), that might be cool.

      I like your idea of being able to always exclude the main image from showing up in the gallery.

      Displaying a list of all the products with missing images is a cool idea too. Wouldn’t be difficult to put together a grid for that. I know this is perfectly on topic, but I do have a bit of sql that will give you all of the skus for products with missing image on a previous post.

      Thanks for your thoughts, appreciate it!

  7. Loopion says:

    It should be built-in. I won’t buy for it though. :s

  8. Timofey says:

    Ready to buy this extension. Very usefull for all my Magento installations.