/
Refactoring of ImageHelper

Refactoring of ImageHelper

Class ImageHelper of In-Portal represents functionality, that we needed to do with images over time. The way how it's written hardcodes image transformation rules or they order.

I'm proposing to individual image transformation rules (e.g. crop, resize, fill, etc.) into a separate plugins, where each plugin class would have 2 methods:

  • listen($format_string) - text, that should be present for this plugin to kick in during image transformation process
  • transform($image_resource) - perform transformation on given image resource and return it's status (true - success, false - error)