Parcourir la source

update bug for jpg and JPG

Shenjian il y a 7 ans
Parent
commit
df22c5b1bd
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      PhotoSorter/Program.cs

+ 2 - 2
PhotoSorter/Program.cs

@@ -40,7 +40,7 @@ namespace PhotoSorter
                     {
                         continue;
                     }
-                    if (Path.GetExtension(file) != ".jpg")
+                    if (Path.GetExtension(file).ToLower() != ".jpg")
                     {
                         continue;
                     }
@@ -98,7 +98,7 @@ namespace PhotoSorter
                     string dateTaken = r.Replace(Encoding.UTF8.GetString(propItem.Value), "-", 2);
                     return DateTime.Parse(dateTaken);
                 }
-                catch (ArgumentException ex)
+                catch (Exception ex)
                 {
                     return DateTime.MinValue;
                 }