Optimize Google Drive images using Zapier and the ShortPixel App
In order to optimize your newly added Google Drive images with ShortPixel, you currently need to be invited to use the ShortPixel Zapier App. Here's the link for the invitation.
After you receive the invitation, you can create the integration having the steps like in the image below. You also need to make sure that you make the Google Drive folder public, in order for ShortPixel to be able to access the image's URL.
- Step #1: Select Google Drive's "New File in Folder" trigger.
- Sign in to your Google Drive account.
- Select the folder to monitor for files.
- Step #2: Click on the '+' icon right after step #1.
- Add a new "Filter" and fill in the fields so the zap only continues if the "Mime Type" contains "image/"
- Step #3: The third step is to configure ShortPixel. Choose "SHORTPIXEL" and "Optimize Image", as in the image below.
Select your ShortPixel account
- And now you need to put ShortPixel to work! :-) On the Customize Image section, choose the following:
- File: Choose "Web Content Link" from step #1.
- Compression Level: Choose according to this.
- Choose if you want to convert CMYK to RGB. If unsure, select "True"
- Choose if you want to keep the EXIF information. If unsure, select "False"
- Choose if you want to resize your image. Outer = Cover & Inner = Contain. Learn more here.
- If relevant, choose the resize width in pixels
- If relevant, choose the resize height in pixels
- Step #4: Find the file in Google Drive using the "Find file" action
Choose your Google account.
- On the Customize File section,
- File Name: choose the "Title" value from the step #1 (New File in Folder in Google Drive).
- Folder: choose the previous folder on step #1 (New File in Folder in Google Drive).
- File Types: choose "Images (any format)".
- Step #5: replace the file using Google Drive's "Replace File":
- Choose again your Google account.
- On the Customize Replace File section you need to fill in the following fields:
- Folder: Choose the previous folder on step #1 (New File in Folder in Google Drive).
- File To Replace: Choose "Custom", and then "ID" of step #4.
- File: Choose "File" field from step #3.
- File Name: Use "Title" from step #1 (New File in Folder in Google Drive).
- File Extension: Use "File Extension" from step #1 (New File in Folder in Google Drive).
That's all, now you can add files inside your Google Drive folder and they will be optimized with ShortPixel! In order to optimize your already present images, as a workaround you will need to move them back and forth, in order to fire the Google Drive's trigger, as Google Drive hasn't got a list feature yet.