Hello there,
Im doing a windows application that basicaly read a .xls wich contains a lot of FILENAME, those filenames are all JPG files and i need to resize them to create 2 sizes of thumbnails (120x? and 260x?). This is done and work well.
But i also need to estimate the size that the file will have on disk when downloaded on 320x? , 800x?, 1024x? and 1080x?) , my application need this information and will store this when i'll write everything in a MYSQL database. The idea is that i dont want those pictures on disk, i'll resize them on demand and send them to the client with a .ASPX page.
Here is a sample of what i do for estamating the size of the 320, :
//imgBase contains information about the image, with Drawing.Image property.
double size;
ImageDimensions imgDim = null;
MemoryStream stream = new MemoryStream()
imgDim = ImageManager.ResizeImageInMemory(imgBase, stream, 320);
size = (stream.ToArray().Length * 1.0) / 1024;
Here's the problem, the estimation with this is WRONG, it gives me for exemple 23ko for a 320x? image, but when i download it its 42ko... almost 2x my estimation.
Anyone can tell me if there's a way to do what i need ? It seems like saving a picture in a memorystream doesnt keep every information to have a true estimation WITHOUT writing any image to disk.
Sorry for my poor english, i did my best
Im doing a windows application that basicaly read a .xls wich contains a lot of FILENAME, those filenames are all JPG files and i need to resize them to create 2 sizes of thumbnails (120x? and 260x?). This is done and work well.
But i also need to estimate the size that the file will have on disk when downloaded on 320x? , 800x?, 1024x? and 1080x?) , my application need this information and will store this when i'll write everything in a MYSQL database. The idea is that i dont want those pictures on disk, i'll resize them on demand and send them to the client with a .ASPX page.
Here is a sample of what i do for estamating the size of the 320, :
//imgBase contains information about the image, with Drawing.Image property.
double size;
ImageDimensions imgDim = null;
MemoryStream stream = new MemoryStream()
imgDim = ImageManager.ResizeImageInMemory(imgBase, stream, 320);
size = (stream.ToArray().Length * 1.0) / 1024;
Here's the problem, the estimation with this is WRONG, it gives me for exemple 23ko for a 320x? image, but when i download it its 42ko... almost 2x my estimation.
Anyone can tell me if there's a way to do what i need ? It seems like saving a picture in a memorystream doesnt keep every information to have a true estimation WITHOUT writing any image to disk.
Sorry for my poor english, i did my best