You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few reasons why I haven't implemented a direct GetImage(), rather than a GetImageUri(). Basically, I'm trying to keep a clean interface, where as little as possible can go wrong. The amount of different ways to do a GetImage() function is huge (return types, caching, proxy-handling, threading, ...), so I almost every case I'd either hit new issues or find people working around it because "It caches in C:\Temp and we're running on linux"...
Instead, I'd propose that you extend the Client class yourself, using an extension method. You could even Subclass the thing if you so wished :). Here's an example to get you (or others) started.
public static class ClientExtensions
{
public static byte[] GetImage(this TMDbClient client, string size, string filePath, bool useSsl)
{
return new WebClient().DownloadData(client.GetImageUrl(size, filePath, useSsl));
}
}
Oh yea, adding a System.Drawing.Image reference, also requires System.Drawing. So we'd break some compatibility somewhere :P
Hi,
As I say, It would be great to retrieve image from Uri.
If you want I can help you. I can make a pull request and if it's good for you, you can integrate my job to yours.
I will make Unit Test of course.
Thank you,
The text was updated successfully, but these errors were encountered: