AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript import wixMedia from 'wix-media-backend'; // Get all images in the media gallery wixMedia.get('images') .then(mediaItems => { mediaItems.forEach(mediaItem => { // Convert each image to JPG format wixMedia.convert(mediaItem, { format: 'jpg' }) .then(jpgItem => { // Replace the original image with the new JPG image wixMedia.update(jpgItem) .catch(error => { console.error(`Error updating media item: ${error}`); }); }) .catch(error => { console.error(`Error converting media item: ${error}`); }); }); }) .catch(error => { console.error(`Error getting media items: ${error}`); }); $w.onReady(() => { // Code to convert product image to JPG });