This deck explains how Kraken-powershell can be used for optimizing image assets using simple powershell commands.
based on blogpost: http://devslice.net/2016/07/kraken-powershell-batch-features/
2. Keeppath
• Keeps the original URL structure intact.
http://domain.com/folder1/folder2/image.jpeg
• Easy way to compress and move all your existing image
assets to AWS or Azure
• Compress Azure Blob or AWS S3 image assets using a simple
cmdlet
3. Keeppath (Azure Blob Storage only)
• Ignores the container name if the destination and source
name are the same
https://c1.blob.core.windows.net/test/folder1/image.jpeg
Won’t include test again.
https://c2.blob.core.windows.net/test/test/folder1/image.jpeg
5. External Storage Image Assets
• Compress images within a storage Container or Bucket
• Copy and compress images from one Container or Bucket to
another (including Azure to Amazon and vice versa)
• Set Header and Metadata information on batch level or Item
level
6. Batch Level Metadata & Headers
• Metadata and Headers parameters are used in conjunction
with -FileUrl or -FilePath.
• Batch level Metadata and Headers are specified globally,
therefore all processed items will be created using the same
data.
8. Image Level Metadata & Headers
• Unique headers and or metadata for each image can be
specified
• To do this its required to use the –OptimizeImageItems
parameter
• Accepts a collection of
Kraken.Powershell.OptimizeImageItem
raken-powershell centers around minimizing images using the kraken.io image optimization web API. However, it isn’t a 1-on-1 representation. The module focuses on batch operations, compressing existing image assets both, from local storage and the web.
herefore, the kraken-powershell module has a couple of unique feature which aren’t available when using the REST API directly. Now, instead of talking, Let’s take a look at the one of the features called Keeppath.
KeepPath keeps the original URL structure intact when compressing public images and saving them within Azure Blob Storage or Amazon S3. It’s easier to understand this by presenting an example.
Azure’s Blob Storage doesn’t support virtual-hosted–style URLs, (Which means that the Container name is always part of the URL). -KeepPath and therefore automatically detects when the container name should be ignored.
Given that Kraken-PowerShell focuses on batch operations, it’s important to know how metadata and headers can be provided when you are using Azure Blob Storage or AWS as your storage provider.