Skip to content

Instantly share code, notes, and snippets.

@bleroy
Last active February 15, 2017 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleroy/73369ffef1cc6327d01c548b92717faf to your computer and use it in GitHub Desktop.
Save bleroy/73369ffef1cc6327d01c548b92717faf to your computer and use it in GitHub Desktop.
using PhotoSauce.MagicScaler;
const int size = 150;
const int quality = 75;
var settings = new ProcessImageSettings() {
Width = size,
Height = size,
ResizeMode = CropScaleMode.Max,
SaveFormat = FileFormat.Jpeg,
JpegQuality = quality,
JpegSubsampleMode = ChromaSubsampleMode.Subsample420
};
using (var output = new FileStream(OutputPath(path, outputDirectory, MagicScaler), FileMode.Create))
{
MagicImageProcessor.ProcessImage(path, output, settings);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment