home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
Deutsches MediaPortal Forum
Plugins & Skins für das MediaPortal
Plugins & Erweiterungen
MPDisplay++ (discontinued)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sa_ddam213" data-source="post: 1080919" data-attributes="member: 89205"><p>[USER=48781]@BassFan[/USER] First to you THANK YOU for helping with the plugin <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Sorry to everyone who has been waiting for me to finish my house repairs, but that's the problem when there is only one developer on a plugin <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" /></p><p></p><p></p><p>Anyway I am looking into the image issue, Really not sure what would be causing the issue as the plugin just reads a file off disk and displays it, there is no magic logic involved.</p><p>I don't remember putting in a specific fix for modified images, I will have to try reproduce the error.</p><p></p><p>The way images work is:</p><p>In the plugin, if you are running MPDisplay on the same PC and MP the plugin will send the filename to MPDisplay to render on screen</p><p></p><p><a href="https://github.com/saddam213/MPDisplay" target="_blank"><u>MPDisplay</u></a> / <a href="https://github.com/saddam213/MPDisplay/tree/master/MediaPortalPlugin" target="_blank"><u>MediaPortalPlugin</u></a> / <strong>ImageHelper.cs</strong> </p><p>[CODE=C#] public static class ImageHelper</p><p> {</p><p> public static APIImage CreateImage(string filename)</p><p> {</p><p> string imageFile = File.Exists(filename)</p><p> ? filename : GUIGraphicsContext.GetThemedSkinFile("\\media\\" + filename);</p><p></p><p></p><p> if (RegistrySettings.InstallType == MPDisplayInstallType.Full)</p><p> {</p><p> return new APIImage(imageFile);</p><p> }</p><p> return new APIImage(FileHelpers.ReadBytesFromFile(imageFile));</p><p> }</p><p> }</p><p>[/CODE]</p><p></p><p>On the MPDisplay side it is rendered as a BitmapImage</p><p></p><p>(<a href="https://github.com/saddam213/MPDisplay" target="_blank"><u>MPDisplay</u></a> / <a href="https://github.com/saddam213/MPDisplay/tree/master/GUIFramework" target="_blank"><u>GUIFramework</u></a> / <a href="https://github.com/saddam213/MPDisplay/tree/master/GUIFramework/Managers" target="_blank"><u>Managers</u></a> / <strong>GUIImageManager.cs)</strong></p><p>[code] /// <summary></p><p> /// Gets a BitmapImage from tshe specified filename.</p><p> /// </summary></p><p> /// <param name="filename">The filename.</param></p><p> /// <returns></returns></p><p> public static BitmapImage GetImage(string filename)</p><p> {</p><p> try</p><p> {</p><p> if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename))</p><p> {</p><p> BitmapImage bmImage = new BitmapImage();</p><p> bmImage.BeginInit();</p><p> // bmImage.DecodePixelWidth = GetScaledImageWidth(filename);</p><p> bmImage.CacheOption = BitmapCacheOption.None;</p><p> bmImage.UriSource = new Uri(filename, UriKind.RelativeOrAbsolute);</p><p> bmImage.EndInit();</p><p> bmImage.Freeze();</p><p> return bmImage;</p><p> }</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Log.Exception("[GetImage] - An exception occured creating BitmapImage", ex);</p><p> }</p><p> return new BitmapImage();</p><p> }</p><p></p><p></p><p> /// <summary></p><p> /// Gets a BitmapImage from a set of image bytes.</p><p> /// </summary></p><p> /// <param name="bytes">The bytes.</param></p><p> /// <returns></returns></p><p> public static BitmapImage GetImage(byte[] bytes)</p><p> {</p><p> try</p><p> {</p><p> if (bytes != null && bytes.Length > 0)</p><p> {</p><p> BitmapImage image = new BitmapImage();</p><p> using (MemoryStream stream = new MemoryStream(bytes, false))</p><p> {</p><p> image.BeginInit();</p><p> // image.DecodePixelWidth = GetScaledImageWidth(bytes);</p><p> image.CacheOption = BitmapCacheOption.None;</p><p> image.StreamSource = stream;</p><p> image.EndInit();</p><p> image.Freeze();</p><p> bytes = null;</p><p> stream.Flush();</p><p> }</p><p> return image;</p><p> }</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Log.Exception("[GetImage] - An exception occured creating BitmapImage", ex);</p><p> }</p><p> return new BitmapImage();</p><p> }</p><p>[/code]</p><p></p><p>As you can see there is not anything extra done to images during creation.</p><p></p><p>The only thing I could think of would be DPI or Depth, but reading the forum it seems you have checked this.</p><p>I need to re-install my development environment this weekend (all filled with dust, LOL) and will see if I can add something, but if you can try different formats, dpi, color palate, depth as well we may be able to avoid custom code for custom images <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>With the majority(not all) of the repairs to my house done I will have some time for MPDisplay again, and will have more and more time as the repairs are finished. So progress may be still slow on the plugin (I don't even know what's changed in MP 1.7 yet)</p><p></p><p>sa_ddam213</p></blockquote><p></p>
[QUOTE="sa_ddam213, post: 1080919, member: 89205"] [USER=48781]@BassFan[/USER] First to you THANK YOU for helping with the plugin :) Sorry to everyone who has been waiting for me to finish my house repairs, but that's the problem when there is only one developer on a plugin :( Anyway I am looking into the image issue, Really not sure what would be causing the issue as the plugin just reads a file off disk and displays it, there is no magic logic involved. I don't remember putting in a specific fix for modified images, I will have to try reproduce the error. The way images work is: In the plugin, if you are running MPDisplay on the same PC and MP the plugin will send the filename to MPDisplay to render on screen [URL='https://github.com/saddam213/MPDisplay'][U]MPDisplay[/U][/URL] / [URL='https://github.com/saddam213/MPDisplay/tree/master/MediaPortalPlugin'][U]MediaPortalPlugin[/U][/URL] / [B]ImageHelper.cs[/B] [CODE=C#] public static class ImageHelper { public static APIImage CreateImage(string filename) { string imageFile = File.Exists(filename) ? filename : GUIGraphicsContext.GetThemedSkinFile("\\media\\" + filename); if (RegistrySettings.InstallType == MPDisplayInstallType.Full) { return new APIImage(imageFile); } return new APIImage(FileHelpers.ReadBytesFromFile(imageFile)); } } [/CODE] On the MPDisplay side it is rendered as a BitmapImage ([URL='https://github.com/saddam213/MPDisplay'][U]MPDisplay[/U][/URL] / [URL='https://github.com/saddam213/MPDisplay/tree/master/GUIFramework'][U]GUIFramework[/U][/URL] / [URL='https://github.com/saddam213/MPDisplay/tree/master/GUIFramework/Managers'][U]Managers[/U][/URL] / [B]GUIImageManager.cs)[/B] [code] /// <summary> /// Gets a BitmapImage from tshe specified filename. /// </summary> /// <param name="filename">The filename.</param> /// <returns></returns> public static BitmapImage GetImage(string filename) { try { if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename)) { BitmapImage bmImage = new BitmapImage(); bmImage.BeginInit(); // bmImage.DecodePixelWidth = GetScaledImageWidth(filename); bmImage.CacheOption = BitmapCacheOption.None; bmImage.UriSource = new Uri(filename, UriKind.RelativeOrAbsolute); bmImage.EndInit(); bmImage.Freeze(); return bmImage; } } catch (Exception ex) { Log.Exception("[GetImage] - An exception occured creating BitmapImage", ex); } return new BitmapImage(); } /// <summary> /// Gets a BitmapImage from a set of image bytes. /// </summary> /// <param name="bytes">The bytes.</param> /// <returns></returns> public static BitmapImage GetImage(byte[] bytes) { try { if (bytes != null && bytes.Length > 0) { BitmapImage image = new BitmapImage(); using (MemoryStream stream = new MemoryStream(bytes, false)) { image.BeginInit(); // image.DecodePixelWidth = GetScaledImageWidth(bytes); image.CacheOption = BitmapCacheOption.None; image.StreamSource = stream; image.EndInit(); image.Freeze(); bytes = null; stream.Flush(); } return image; } } catch (Exception ex) { Log.Exception("[GetImage] - An exception occured creating BitmapImage", ex); } return new BitmapImage(); } [/code] As you can see there is not anything extra done to images during creation. The only thing I could think of would be DPI or Depth, but reading the forum it seems you have checked this. I need to re-install my development environment this weekend (all filled with dust, LOL) and will see if I can add something, but if you can try different formats, dpi, color palate, depth as well we may be able to avoid custom code for custom images :) With the majority(not all) of the repairs to my house done I will have some time for MPDisplay again, and will have more and more time as the repairs are finished. So progress may be still slow on the plugin (I don't even know what's changed in MP 1.7 yet) sa_ddam213 [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
Deutsches MediaPortal Forum
Plugins & Skins für das MediaPortal
Plugins & Erweiterungen
MPDisplay++ (discontinued)
Contact us
RSS
Top
Bottom