I'm creating a plugin in Craft CMS and it has a feature where you can apply certain image effects and after you are done, you can save it in the configured Asset volume. I know that ImagerX also does most of this stuff but I think it will return the image after doing the processing but what I want is the final image to be stored in the same volume.

I think there are two ways to do this but I would like to know if there are any another options and if not which of the below two approaches is the best one.

  1. I can create a new Asset by using the Craft::$app->getElements()->saveElement API call but I think this will result in the new image appearing in the Assets dialogue which is not quite ideal.

  2. I have to upload the new image to the respective Asset volume where the original image is living and then manage the manipulations in the plugin. This would mean that I will have to integrate with all the Storage service providers like aws, etc

Appreciate some advice.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.