mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[fxcop] image resizer ui (#6841)
* adjustments * Settings fixed * Getting resizing tests operational again * fixed default vs loading from settings * one small tewak
This commit is contained in:
@@ -24,12 +24,15 @@ namespace ImageResizer.Models
|
||||
|
||||
// NB: We read these from stdin since there are limits on the number of args you can have
|
||||
string file;
|
||||
while ((file = standardInput.ReadLine()) != null)
|
||||
if (standardInput != null)
|
||||
{
|
||||
batch.Files.Add(file);
|
||||
while ((file = standardInput.ReadLine()) != null)
|
||||
{
|
||||
batch.Files.Add(file);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < args.Length; i++)
|
||||
for (var i = 0; i < args?.Length; i++)
|
||||
{
|
||||
if (args[i] == "/d")
|
||||
{
|
||||
@@ -43,9 +46,7 @@ namespace ImageResizer.Models
|
||||
return batch;
|
||||
}
|
||||
|
||||
public IEnumerable<ResizeError> Process(
|
||||
CancellationToken cancellationToken,
|
||||
Action<int, double> reportProgress)
|
||||
public IEnumerable<ResizeError> Process(Action<int, double> reportProgress, CancellationToken cancellationToken)
|
||||
{
|
||||
double total = Files.Count;
|
||||
var completed = 0;
|
||||
@@ -66,7 +67,9 @@ namespace ImageResizer.Models
|
||||
{
|
||||
Execute(file);
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
errors.Add(new ResizeError { File = Path.GetFileName(file), Error = ex.Message });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user