I normally use Shrine but tried out Active Storage for a new project. I understand that you can do ImageMagick/vips postprocessing via ‘representations’ both for images and video previews.
Let’s say I have a model with a has_one_attached :file (taking both images and videos ) and am using several representations/variants for thumbnail, small and medium sizes (resize_to_fit: …) from either the original image or from the preview image of the attached video.
This works pretty well so far, but I now have to do some additional postprocessing of the variant files. For example running jpegoptim via image_optim on thumbnails, small and medium image variants.
What’s the best way to do this with ActiveStorage or is this not possible at the moment?
I’d like to avoid modifying the files on S3 directly and do this step just after ImageMagick or vips finished and before the new variant is uploaded to S3.