locked
[UWP] Thumbnails and file extension assets RRS feed

  • Question

  • Hi,

    I'm developing a photo viewing app and am trying to understand how to customise the icons and thumbnails shown in File Explorer when my app is set as the default for opening certain image files.

    In this piece of documentation - https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/app-assets, it mentions 'File extension assets' with the name *LogoExtensions.targetsize-*.png, but it doesn't say what the first * should be replaced by. Also, it says 'Impacted apps: Music, Video, Photos, Microsoft Edge, Microsoft Office', so does that mean that this doesn't apply to my app? If so, is there any way to provide assets such that the icon in the details view in File Explorer is different from my usual app icon (I want it to look like a file)?

    There is also a strange issue with the thumbnails view in File Explorer. If I set my app as the default app to open certain RAW image formats such as .cr2, then the thumbnails for these files (which used to correctly show a thumbnail of the image) are replaced by my app logo. Is there any way I can prevent this from happening? This also affects the thumbnail returned when I call StorageFile.GetThumbnailAsync in my app.

    Monday, August 13, 2018 9:54 AM

All replies

  • Hi,

    For the first question, as the document said, it should only affect the apps in it mentioned. If it could be done, it will show Every UWP app like other section.

    For the second question, this behavior is strange. What's the ThumbnailMode when you using GetThumbnailAsync method? May I know the OS version and Target version of your app?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 14, 2018 7:14 AM
  • Hi Roy,

    Thanks for the reply. Actually, I think I solved the first question. When specifying the fileTypeAssociation extension in the app package manifest, there is an option for a logo. One thing that isn't documented is that it appears that this logo supports the myname.targetsize-*.png naming convention for icons of different sizes, so perhaps that's what the documentation was referring to. If so, it appears that the first * in *LogoExtensions.targetsize-*.png can be replaced by anything, and it applies to all apps with a fileTypeAssociation extension, not just those listed. One thing I found in case anyone else is interested is that if you update these file icons then you need to change this name else the icons in File Explorer will not update even on reinstall of the app.

    Perhaps the information above could be added to the documentation?

    For the second question. Thanks for the suggestion. When I change from ThumbnailMode.SingleItem to ThumbnailMode.PicturesView, I get a proper thumbnail, which is good. However, in general for JPEG files I avoid using ThumbnailMode.PicturesView because in that case for JPEG files for some reason the thumbnails are always in 3:2 ratio. But this still doesn't solve the problem of the thumbnail previews not being displayed in File Explorer. It is possible this is intentional, because I suppose these camera RAW file extensions are not reserved by the OS and so my app could be using these file extensions for some file format other than images. But in that case I think there should be a method of preserving the behaviour whereby image previews are displayed.

    Tuesday, August 14, 2018 2:27 PM
  • Hi,

    I'm contact this with other engineers to see if this is excepted.

    There might be some time delay.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 17, 2018 2:11 AM
  • Hi,

    This is excepted behavior. When a UWP app register for a file type, it probably override the thumbnail handler shell extension. This behavior will disappear when you uninstall your app. The thumbnail will turn back to what it looks like before.

    Here is more information for thumbnail handler

    Best regard,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 12, 2018 10:22 AM
  • Thanks for the info. Is there any way to override this behaviour in a UWP app? I don't want to suggest to users that the solution is to uninstall my app!

    Thanks

    Friday, September 14, 2018 5:45 PM