hi people
I have imported "blob" data from mysql to an ms-sql 2000 "Image" field, using ms-sql enterprise manager. However my c# image veiwer does not work on the imported blob data (it does work on data I add to ms-sql via my web application).
Is there any way I can check that the blob data creates a valid image? If anyone has any ideas of how I can debug the data coming out that would be great. Or perhaps someone can point me to somewhere I can get some help?
any pointers are much appreciated!
Greg
p.s here is the code for my Image Viewer!
<%@ WebHandler Language="C#" Class="imageViewer" %>
using System;
using System.Web;
using System.IO;
public class imageViewer : IHttpHandler { public void ProcessRequest (HttpContext context) {product prod = new product(context.Request.QueryString["code"].ToString());
prod.load();
Stream stream = null;
context.Response.ContentType = "image/jpeg";
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.BufferOutput = false;
int buffersize = 1024;
byte[] buffer = new byte[buffersize];
stream = new MemoryStream(prod.ImageThumb); int count = stream.Read(buffer, 0, buffersize);while (count > 0)
{
context.Response.OutputStream.Write(buffer, 0, count);
count = stream.Read(buffer, 0, buffersize);
}
}
public bool IsReusable {
get {
return false;
}
}
}
I have imported "blob" data from mysql to an ms-sql 2000 "Image" field, using ms-sql enterprise manager. However my c# image veiwer does not work on the imported blob data (it does work on data I add to ms-sql via my web application).
Is there any way I can check that the blob data creates a valid image? If anyone has any ideas of how I can debug the data coming out that would be great. Or perhaps someone can point me to somewhere I can get some help?
any pointers are much appreciated!
Greg
p.s here is the code for my Image Viewer!
<%@ WebHandler Language="C#" Class="imageViewer" %>
using System;
using System.Web;
using System.IO;
public class imageViewer : IHttpHandler { public void ProcessRequest (HttpContext context) {product prod = new product(context.Request.QueryString["code"].ToString());
prod.load();
Stream stream = null;
context.Response.ContentType = "image/jpeg";
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.BufferOutput = false;
int buffersize = 1024;
byte[] buffer = new byte[buffersize];
stream = new MemoryStream(prod.ImageThumb); int count = stream.Read(buffer, 0, buffersize);while (count > 0)
{
context.Response.OutputStream.Write(buffer, 0, count);
count = stream.Read(buffer, 0, buffersize);
}
}
public bool IsReusable {
get {
return false;
}
}
}