public static void CompressImages(string folderPath, IProgress progress)
{
var imageFiles = Directory.GetFiles(folderPath, "*.png");
int completed = 0;
foreach (string path in imageFiles)
{
if (Path.GetFileName(path).ToLowerInvariant() == "placeholder.png")
return;
progress.ProgressIndicator.PercentCompleted = (int)(100.0 * (float)completed / (float)imageFiles.Length);
CompressImage(path, progress);
completed++;
}
}