Skip to content

StorageFile.GetThumbnailAsync does not generate thumbnails for OneDrive files #1874

@lmadhavan

Description

@lmadhavan

Describe the bug

StorageFile.GetThumbnailAsync generally triggers generation of a thumbnail if one doesn't already exist for the specified file. This works for local files, however for files that are stored on OneDrive, it simply returns a placeholder image unless a thumbnail was already generated previously by File Explorer.

Steps to reproduce the bug

  1. Create a folder in OneDrive and add a photo to it (make sure the folder is not available locally, for example by using the web UI).
  2. Call GetThumbnailAsync on the photo. The call succeeds but simply returns a placeholder image. File Explorer initially displays the same placeholder for the folder icon.
  3. Navigate inside the folder using File Explorer. This triggers generation of the thumbnail, after which both GetThumbnailAsync and the folder icon display the correct thumbnail.

Expected behavior

GetThumbnailAsync should trigger the same code path as File Explorer to generate the thumbnail, unless ThumbnailOptions.ReturnOnlyIfCached is specified, in which case it should return null as specified in the documentation. Returning a placeholder when the thumbnail has not been generated makes it impossible for the app to tell if the call actually succeeded or not.

Screenshots

Before thumbnail has been generated:
image

After thumbnail has been generated:
image

NuGet package version

No response

Packaging type

No response

Windows version

May 2021 Update (19043)

IDE

Visual Studio 2019

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions