kwangsing 0 Posted April 9, 2023 Share Posted April 9, 2023 (edited) Hi All, I'm searching and try to figure out how to make a C# plugin in Emby, and had some different situation with the same topic. I'll try to explain them clearly. First I had a "CustomClass" would handle and request all the Metadata I wanted, including Images and other detail of the movie. Here's the question 1. I implemented an ImageProvider inherited from IRemoteImageProvider , and be able to work if I just pass the URL in GetImages, If I try to return a fake HttpResponse and replace the Content I edited, it would still try to visit the url I gave (like url = "post.jpg") and cause Error.(exceptions No file Found ) I need to crop the image after I received the image actually. 2. And It brings other issue here, other MediaBrowser.Controller.Providers like IDynamicImageProvider, or ILocalImageProvider may not works in this case? my cropped image only in memory (as byte[] BTW) , also none of them could return multiple imageType as IRemoteImageProvider. (GetImages method has no IEnumerable on return). most important is I tryed this below and IDynamicImageProvider part do nothing. (I pass the ImageType.Primrary and the stream of image). ignore the error : P 3. I had a annoy issue with backdrop image part, every time I click view and it would keep adding new image, How would I fix this issue ? here's the code: Edited April 9, 2023 by kwangsing fix some words Link to comment Share on other sites More sharing options...
Luke 37029 Posted April 10, 2023 Share Posted April 10, 2023 Hi, if you just want to provide a remote image from a url, then you're doing the right thing by implementing IRemoteImageProvider . Link to comment Share on other sites More sharing options...
kwangsing 0 Posted April 11, 2023 Author Share Posted April 11, 2023 (edited) @Luke Hi Luke, How about cropped images? My Image from Internet, I saved my cropped images as byte[] in memery first, and I gave a special words in url , then I should knew when to return a fake HttpResponseInfo instead of make a remote request. But the true is, Emby core still make a request and cause Error (Invaild URI or No such File Found). how could I avoid that ? Edited April 11, 2023 by kwangsing Link to comment Share on other sites More sharing options...
Luke 37029 Posted April 11, 2023 Share Posted April 11, 2023 GetImageResponse is actually not really used anymore, unless the user has enabled downloading images in advance and the image gets downloaded immediately. Otherwise, the url you returned just gets recorded in the database and then downloaded separately later once it's needed. Link to comment Share on other sites More sharing options...
kwangsing 0 Posted April 11, 2023 Author Share Posted April 11, 2023 (edited) @Luke Then how should I feed a image from byte[] or stream not URL after all? IDynamicImageProvider looks like a good start, when I inherited them together, IDynamicImageProvider part do nothing. Edited April 11, 2023 by kwangsing Link to comment Share on other sites More sharing options...
Solution Luke 37029 Posted April 11, 2023 Solution Share Posted April 11, 2023 32 minutes ago, kwangsing said: @Luke Then how should I feed a image from byte[] or stream not URL after all? IDynamicImageProvider looks like a good start, when I inherited them together, IDynamicImageProvider part do nothing. You'd have to just implement IDynamicImageProvider. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now