I was trying to implement Flickr ECL, using extension and configured in my Tridion.
Images and Albums are reflecting in Tridion, but thumbnail images are not working properly, I see a blank image.
On Folder View
ECL Component View
I have debug on GetThumbnailImage
method it is working fine, cleared cache many times but still I was getting blank.
Update:
I tried to inspect img(blank)
in Component view, it was pointing to http://localhost/WebUI/Editors/Base/icon.png?target=view&maxwidth=320&maxheight=200&uri=ecl%3A9-flickr-38587920765_b15971826b_72157690242528371-img-file&modified=20180104062538&state=ecl%3AFile.L0P0
GetThumbnailImage code
public byte[] GetThumbnailImage(IEclUri eclUri, int maxWidth, int maxHeight)
{
// only return thumbnails for the actual photos
if (eclUri.ItemType == EclItemTypes.File && eclUri.SubType == "img")
{
// format of photo item id: [flickr photo id]_[flickr photo secret]_[flickr photo set id]
string[] ids = eclUri.ItemId.Split('_');
FlickrInfo photo = Provider.Flickr.GetPhotoInfo(ids[0], ids[1], ids[2]);
WebClient webClient = new WebClient();
byte[] thumbnailData = webClient.DownloadData(Flickr.GetPhotoUrl(photo, maxWidth));
using (MemoryStream ms = new MemoryStream(thumbnailData, false))
{
return Provider.HostServices.CreateThumbnailImage(maxWidth, maxHeight, ms, Flickr.MaxWidth, Flickr.MaxHeight, null);
}
}
return null;
}
GetThumbnailImage(IEclUri eclUri, int maxWidth, int maxHeight)
method? I think your implementation ofCreateThumbnailImage()
is not returning correct bytes of thumbnails. I guess if you debug the code on these you will get to know what you are missing.Flickr.GetPhotoUrl(photo, maxWidth)
(line 111 of github.com/bkoopman/sdl-tridion-world/blob/master/…) return a visible URL of a photo?