You have a couple of tasks,
- Identify all the image styles
- Identify where they're used. You can have multiple node displays, views, display suite, panels, etc.
- Check if they're defined in code (features/custom modules)
- Remove extra ones that aren't being used
They all apply to images. So your first step if find image fields and where they're used. Drupal has a report for that.
admin/reports/fields
For Views, you can use,
admin/reports/fields/views-fields
For each content type, check all displays see which ones are used,
admin/structure/types/manage/<CONTENT_TYPE>/display
admin/structure/types/manage/<CONTENT_TYPE>/display/teaser
admin/structure/types/manage/<CONTENT_TYPE>/display/<OTHER_DISPLAYS>
Then see if you have Panels or Display Suite. And check those modules to see if they reference other image styles.
After that, you can start looking into your code. This could be tricky. Assuming the contrib modules are in a separate folder,
sites/all/modules/contrib
It's easy,
grep -rn 'image_format_machine_name' sites/all/modules | grep -v 'contrib'
But if everything is thrown together into modules/
, contributed, custom, feature modules, you'll have to exclude contributed modules manually. Probably Excel would be your best bet here.
I think basically that should cover the places where they're used.
Not sure if anyone would have any other ideas.