File tree 2 files changed +6
-2
lines changed
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>
60
60
[ Editor ( typeof ( DirectoryNameEditor ) , typeof ( UITypeEditor ) ) ]
61
61
public string BackupLocation { get ; set ; }
62
62
63
- [ Category ( "Settings" ) , DefaultValue ( 99 ) , Description ( "Image quality" ) ]
63
+ [ Category ( "Settings" ) , DefaultValue ( 95 ) , Description ( "Image quality" ) ]
64
64
public int PhotoQuality { get ; set ; }
65
65
66
+ [ Category ( "Settings" ) , DefaultValue ( 4 ) , Description ( "Maximum number of concurrent operations" ) ]
67
+ public int MaxDegreeOfParallelism { get ; set ; }
68
+
66
69
public Settings ( )
67
70
{
68
71
ImageExtensions = new List < string > ( ) ;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ private void ResizePhotosInFolder(string folderPath)
103
103
104
104
OnProgressChanged ( current , max ) ;
105
105
106
- Parallel . ForEach ( files , filePath =>
106
+ Parallel . ForEach ( files , new ParallelOptions { MaxDegreeOfParallelism = settings . MaxDegreeOfParallelism } , filePath =>
107
107
{
108
108
try
109
109
{
@@ -129,6 +129,7 @@ private void ResizePhotosInFolder(string folderPath)
129
129
}
130
130
catch ( Exception ex )
131
131
{
132
+ MessageBox . Show ( ex . Message ) ;
132
133
Console . WriteLine ( ex . Message ) ;
133
134
}
134
135
finally
You can’t perform that action at this time.
0 commit comments