/// <summary> /// Returns the thumbnail image for the given item. /// </summary> /// <param name="key">Item key.</param> /// <param name="size">Requested image size.</param> /// <param name="useEmbeddedThumbnails">Embedded thumbnail usage.</param> /// <param name="useExifOrientation">true to automatically rotate images based on Exif orientation; otherwise false.</param> /// <param name="useWIC">true to use Windows Imaging Component; otherwise false.</param> /// <returns>The thumbnail image from the given item or null if an error occurs.</returns> public override Image GetThumbnail(object key, Size size, UseEmbeddedThumbnails useEmbeddedThumbnails, bool useExifOrientation, bool useWIC) { if (disposed) { return(null); } string filename = (string)key; //Trace.WriteLine("FileAdaptorGetThumbnail:" + filename); return(ThumbnailExtractor.FromFile(filename, size, useEmbeddedThumbnails, useExifOrientation, useWIC)); }
/// <summary> /// Returns the thumbnail image for the given item. /// </summary> /// <param name="key">Item key.</param> /// <param name="size">Requested image size.</param> /// <param name="useEmbeddedThumbnails">Embedded thumbnail usage.</param> /// <param name="useExifOrientation">true to automatically rotate images based on Exif orientation; otherwise false.</param> /// <param name="useWIC">true to use Windows Imaging Component; otherwise false.</param> /// <returns>The thumbnail image from the given item or null if an error occurs.</returns> public override Image GetThumbnail(object key, Size size, UseEmbeddedThumbnails useEmbeddedThumbnails, bool useExifOrientation, bool useWIC) { if (disposed) { return(null); } string filename = (string)key; if (File.Exists(filename)) { return(ThumbnailExtractor.FromFile(filename, size, useEmbeddedThumbnails, useExifOrientation, useWIC)); } else { return(null); } }