File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,12 @@ public class Settings : SettingsBase<Settings>
6060 [ Editor ( typeof ( DirectoryNameEditor ) , typeof ( UITypeEditor ) ) ]
6161 public string BackupLocation { get ; set ; }
6262
63- [ Category ( "Settings" ) , DefaultValue ( 99 ) , Description ( "Image quality" ) ]
63+ [ Category ( "Settings" ) , DefaultValue ( 95 ) , Description ( "Image quality" ) ]
6464 public int PhotoQuality { get ; set ; }
6565
66+ [ Category ( "Settings" ) , DefaultValue ( 4 ) , Description ( "Maximum number of concurrent operations" ) ]
67+ public int MaxDegreeOfParallelism { get ; set ; }
68+
6669 public Settings ( )
6770 {
6871 ImageExtensions = new List < string > ( ) ;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ private void ResizePhotosInFolder(string folderPath)
103103
104104 OnProgressChanged ( current , max ) ;
105105
106- Parallel . ForEach ( files , filePath =>
106+ Parallel . ForEach ( files , new ParallelOptions { MaxDegreeOfParallelism = settings . MaxDegreeOfParallelism } , filePath =>
107107 {
108108 try
109109 {
@@ -129,6 +129,7 @@ private void ResizePhotosInFolder(string folderPath)
129129 }
130130 catch ( Exception ex )
131131 {
132+ MessageBox . Show ( ex . Message ) ;
132133 Console . WriteLine ( ex . Message ) ;
133134 }
134135 finally
You can’t perform that action at this time.
0 commit comments