Răsfoiți Sursa

update bug for jpg and JPG

Shenjian 7 ani în urmă
părinte
comite
df22c5b1bd
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      PhotoSorter/Program.cs

+ 2 - 2
PhotoSorter/Program.cs

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