Is there any way in powershellscript to get the thumbnail url from Picture library.? Actually i wan to use in custom search display template to get the thumbnail image.
1 Answer
Its not possible, but it is exposed in the Search Schema in the site settings menu, which is probably better for your purposes anyway.
go to this URL in your site collection: /_layouts/15/listmanagedproperties.aspx?level=sitecol
and then search for the term 'Thumbnail' without quotes. You will see the field name which is PictureThumbnailURL. It is mapped (by default) to the following 3 crawled properties: ows_AlternateThumbnailUrl, ows_EncodedAbsThumbnailUrl, ows_DMSCoverImage.
None of these fields: PictureThumbnailURL, ows_AlternateThumbnailUrl, ows_EncodedAbsThumbnailUrl, ows_DMSCoverImage are accessible (from my testing) in PnP Sharepoint or SPO cmdlets.
You can also get it via REST. see this: Retrieve Images from Image Library in thumbnail format using Rest API
You can also manually build the URL in the following manner.
Original Image File Name and URL:
https://yourtenant.sharepoint.com/SharedImages/logo-lg.png
The above Image's Thumbnail URL:
https://yourtenant.sharepoint.com/SharedImages/_t/logo-lg_png.jpg
the '.' in the File name is converted to an underscore.
the file extension for the thumbnail is always jpg
the thumbnail always has the same absolute path as the original file, except it is in a hidden folder within that path '/_t/'
Please Mark As Answer If It Answered Your Question