1
0
Fork 0
mirror of https://gitlab.com/sbrl/GalleryShare.git synced 2018-06-12 22:45:16 +00:00

Show newest files in a direcotry in the preview, not the oldest

This commit is contained in:
Starbeamrainbowlabs 2017-07-21 20:43:43 +01:00
parent c8985502ae
commit e13c6a14b3

View file

@ -34,7 +34,7 @@ namespace GalleryShare
public static Image GenerateDirectoryThumbnail(string dirPath, Size thumbnailSize) public static Image GenerateDirectoryThumbnail(string dirPath, Size thumbnailSize)
{ {
List<string> dirFiles = new List<string>(Directory.GetFiles(dirPath)); List<string> dirFiles = new List<string>(Directory.GetFiles(dirPath));
dirFiles.Sort( (a, b) => File.GetLastWriteTime(a).CompareTo(File.GetLastWriteTime(b)) ); dirFiles.Sort( (a, b) => File.GetLastWriteTime(b).CompareTo(File.GetLastWriteTime(a)) );
Bitmap resultImage = new Bitmap(thumbnailSize.Width, thumbnailSize.Height); Bitmap resultImage = new Bitmap(thumbnailSize.Width, thumbnailSize.Height);
using(Graphics context = Graphics.FromImage(resultImage)) using(Graphics context = Graphics.FromImage(resultImage))