| |||||||
| fixed 0.2.0.0 bugs Bugreports that have been resolved will be moved in here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Jan 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
| This is my first (bug?) post so not sure if this is where it goes. This is the temporary fix I came up with - which I know you guys can implement a better, more generic code for. When viewing pictures stored in windows shares I get blank pics. Mediaportal.log reported an exception in picture.load stating that it was an access denial error with the picture. Even after allowing full rights with the share the same error occured. After doing some digging the problem seemed to boil down to Util\Pictures.cs Load(string strPic,....) function. The problem was with the code Code: using (FileStream stream = new FileStream(strPic, FileMode.Open)) So I decided to change the code to: Code: using (FileStream stream = new FileStream(strPic, FileMode.Open, FileAccess.Read)) Turns out the problem has something to do with the stream outlined in http://www.pixvillage.com/blogs/devb...03/09/154.aspx I created a new class from the code referenced in the above link and called it StreamedImage.cs and placed it in the util directory. Here is the code: Code: using System;
using System.Drawing;
using System.IO;
namespace MediaPortal.Util
{
public class StreamedImage : IDisposable
{
private Image image;
private Stream stream;
public StreamedImage(Stream stream, bool useEmbeddedColorManagement, bool validateImageData)
{
this.stream = stream;
this.image = System.Drawing.Image.FromStream(stream, useEmbeddedColorManagement, validateImageData);
}
public Image Image
{
get { return image; }
}
public Stream Stream
{
get { return stream; }
}
public void Dispose()
{
if (image != null)
{
image.Dispose();
image = null;
}
if (stream != null)
{
stream.Close();
stream = null;
}
}
}
}
Code: using (FileStream stream = new FileStream(strPic, FileMode.Open)) Code: StreamedImage sim = new StreamedImage(new FileStream(strPic, FileMode.Open, FileAccess.Read), true, false); Code: theImage = Image.FromStream(stream, true, false); This was changed to: Code: theImage = sim.Image; |
| | |
![]() |
| Bookmarks |
| Tags |
| blank, mypictures, pics, shares, viewing |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Failed to start timeshifting Unable to create graph | Topher5000 | General Support | 31 | 2008-09-06 18:35 |
| TV recording question/problem | 'Arry | Installation, configuration support | 9 | 2006-09-22 14:14 |
| Recording from TV | 'Arry | General Support | 2 | 2006-09-20 01:12 |
| MyPictures goes white after displaying a random nmbr of pics | strawberry | General Support | 6 | 2006-07-31 21:25 |
| Cant get MyTV to work (2.0 RC3)? | mdolan | General Support | 3 | 2006-03-30 15:58 |