Closed tipa closed 7 years ago
hi @tipa , current the smallSquare thumbnail does return if you specify select it explicitly and there are some efforts needed:
build you request like
var size = "smallSquare";
var expandString = string.Format("thumbnails(select={0})",size);
var item = await this.oneDriveClient.Drive.Items[id].Request().Expand(expandString).GetAsync();
// parse the thumbnail
var thumbnailSet = item.Thumbnails.CurrentPage.FirstOrDefault(set => set.AdditionalData?[size] != null);
if (thumbnailSet != null)
{
var serializer = new Serializer();
var thumbnail = serializer.DeserializeObject<Thumbnail>(thumbnailSet.AdditionalData[size].ToString());
}
this should also work if you want to select customized thumbnails, please let me know if it works.
I have come to a different solution via url parameters: ?width=80&height=80&cropmode=center
cool, good to know that.
@tipa how did you acheive passing in custom url parameters using the onedrive sdk?
Currently, square thumbnails like "smallSquare" are not supported. Probably custom sized thumbnails could be somehow supported too...
Ref: https://dev.onedrive.com/items/thumbnails.htm#size-values https://dev.onedrive.com/items/thumbnails.htm#custom-thumbnail-sizes