I completed the following tutorial to write a function (see code snippet) through which each time I add something to my Azure Blob storage, a resized copy will be saved in an additional container.
https://ppolyzos.com/2016/12/30/resize-images-using-azure-functions/
The problem is that Azure blob storage stores the resized images as octet-stream (Azure's default setting) rather than as in previous jpg format
The following tutorial says I can simply add Format = Jpeg; to achieve that format as demonstrated in the code snippet below.
http://jameschambers.com/2016/11/Resizing-Images-Using-Azure-Functions/
Does anybody know how I can keep the original format jpeg when making a resized copy of an image using azure functions?
using ImageResizer;
using ImageResizer.ExtensionMethods;
public static void Run(Stream myBlob, string blobname, string blobextension, Stream outputBlob, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{blobname} \n Size: {myBlob.Length} Bytes");
var instructions = new Instructions
{
Width = 200,
Mode = FitMode.Carve,
Scale = ScaleMode.Both,
Format = Jpeg
};
instructions.OutputFormat = OutputFormat.Jpeg;
ImageBuilder.Current.Build(new ImageJob(myBlob, outputBlob, instructions));
}
Many thanks!