VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: derek webster on December 16, 2020, 12:51:16 PM

Title: Responsive image plugin
Post by: derek webster on December 16, 2020, 12:51:16 PM
Hi, I'm trying to develop a plugin that automatically converts any uploaded media into multiples webp or jpg images with different resolutions. So far I'm able to do this using the  plgVmAfterStoreProduct trigger. But the issue I'm running into is that my function cant really run until the image has fully uploaded. so it fails at first. If I wait a second then save a product again then the script works as the image file has obviously uploaded in that time.

My question is... Can anyone suggest a better method for triggering this script? Is there anyway to attach a script like this on to the end of the MediaUpload function? I couldnt find any triggers to allow this.
I'm more of a front end dev - I'm just dipping my toe in writing a plugin.

Many thanks

I'm using VirtueMart 3.8.6 10373

Title: Re: Responsive image plugin
Post by: pinochico on December 16, 2020, 13:21:04 PM
this plugin allready exist
Title: Re: Responsive image plugin
Post by: derek webster on December 17, 2020, 01:05:39 AM
Hm I searched a long time and never found anything. Perhaps you could post a hint as to the name of this plugin? Perhaps it doesn't do exactly as I'd like.
It's still been a good learning curve for someone who has never really done any development work before.
Title: Re: Responsive image plugin
Post by: pinochico on December 17, 2020, 17:04:42 PM
https://dj-extensions.com/dj-webp

We use two years, I think
Title: Re: Responsive image plugin
Post by: derek webster on January 12, 2021, 12:59:42 PM
Sorry for the delay, Thank you  - yes this plugin looks great just exactly what I need