Hi, in this video we will take a look
at a simple workflow that will resize an image and update EXIF data, when a new
image is uploaded to a document library
in SharePoint Online. To summarize the workflow,
we will upload an image file to a SharePoint library. The workflow will then resize the image and edit
its EXIF data. Specifically, the Author and Copyright. Because this operation cannot be done using the default set of activities available in SharePoint Online, we will use additional activities available in
HarePoint Workflow Extensions for Office 365. We will use the Resized Images library
for the workflow to work with. In order to save space, we disable versioning
in the settings.That means the original image
will be replaced by the resized image. Let’s start with SharePoint Designer.
Add a new list workflow connected to our library. First, we add a Resize Image
action from the Image group. We point the workflow to the Encoded Absolute URL
of the image file that it should work on. We are going to resize the image
to 1024 pixels in width by 1024 pixels in height. If we chose to keep the aspect ratio
in the parameters, the resulting images
would be 1024 pixels on their longer side. To save space, we will not store the original file.
It will be rewritten with a resized version. Next, we specify whether smaller
images should be resize. We choose No. Our next task is to add a copyright
information to the files EXIF Copyright
Notice property. For that, we use the Set EXIF Properties
on Image action from the Images group. Here we again point to the URL
of the file, the workflow should work on. Choose the parameter to be edited
and state its new value. In this example, we will make it a simple text:
“The Copyright Notice”. Lastly, we add the Company Name as the author,
but only if the corresponding field is empty. To ensure that we need to get data from the Artist property and store it in a new variable Author. We use the Get EXIF Properties action
from the Image group. For cases where the author information is not specified
in the files EXIF data, we create a default value. To do this, we will add a condition If Variable is Empty. And using the Set EXIF Properties action
we replace this empty field
with our Company Name. We can now finish the body of the workflow. We set the workflow to be executed every time
a new item is added to the library. Let’s publish the workflow to our website. As a test, we upload an image file of 6 MB
that has no data in the EXIF Author and Copyright fields. Our new workflow starts right after the file is uploaded and the workflow is completed moments later. Let’s check the logs to confirm
that everything worked correctly.
And check each step. Our Resized Images library contains a resized image. In order to check the EXIF data, we download this new image and open the Details tab in the File Properties. As you can see, the EXIF data was changed.
As well as image dimensions and
file size, which is now less than 500 KB. That was a basic example of what can be achieved
with the help of additional actions
provided by HarePoint workflow solutions, which can help you create complex
and flexible workflows without coding
or in-depth configuration. Feel free to download a 30-day trial of the product
or contact us for a personal demo session.