fballiano / openmage-image-cleaner

Image cleaner for Magento 1 and OpenMage. Cleans orphans category, product and wysiwyg images.
19 stars 3 forks source link

Color Swatches feature? #17

Open ADDISON74 opened 3 years ago

ADDISON74 commented 3 years ago

What do you thing about adding Color Swatches in the list for removing the orphan images?

fballiano commented 3 years ago

for sure, I never used the swatches so I'd have to look into that :-)

ADDISON74 commented 3 years ago

Check this out: https://info2.magento.com/rs/magentosoftware/images/Magento_Community_Edition_User_Guide_Latest.pdf.

Pages 209 - 226 Chapter 16: Swatches

fballiano commented 3 years ago

from what I'm reading swatches images are in wysiwyg/swatches folder, which we should exclude from the processing right?

ADDISON74 commented 3 years ago

You're right the swatch images are stored in this directory /media/wysiwyg/swatches.

Your extension checks already the contents of the WYSIWYG directory and lists all orphan files. The question is whether we should separate the swatches and treat them in a special way.

fballiano commented 3 years ago

in the meanwhile I pushed https://github.com/fballiano/magento1-image-cleaner/commit/c76c077d2ebcfc45055b2ce922f22e96557fca54 which avoid processing wysiwys/swatches if swatches are enabled (during a wysiwyg sync)

ADDISON74 commented 3 years ago

Excellent. Skipping this directory was very important to avoid any issues.

After investigating custom swatches feature here are more insides. Before using the swatches coming from this directory you have to do the following actions:

In conclusion, a swatch image becomes orphan when its value it is not associated with an attribute value (e.g. attribute Color has no Red value, but there is a red.png file).