The function GetContentType() should be returning the correct mime type. imageFormat is set to the RawFormat at the time the image is loaded. I stepped through the code and it appears to be working as expected.
If you wish to hard code all content types for the images to image/jpeg, you can modify getContentType() to always return "image/jpeg".
Hope that helps.
-KIRBY
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found the problem. Using an HTTP Viewer I looked at the header for the images. The correct content-type was being returned. As a swag I turned off output cache for thumbnail.aspx. This now allows the save as dialog box to know what the real content type is. I find it strange that with output cache turned on that the save as box could not determine the content type even though it was specified in the HTTP header.
As an added bonus I now am setting the content-disposition to the file name so the user will get a default file name based on the original file name.
I'll get a new build out later today. And thanks for finding this problem!
-KIRBY
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have downloaded the new version of your album software.
If I right click in IE on an image I do not get displayed the jpeg ContentType.
In the "old" album software I used
Response.ContentType = "image/jpeg";
thumbnail.Save(Response.OutputStream,image.RawFormat);
I the new version you use
Response.ContentType = GetContentType( imageFormat );
image.Save( Response.OutputStream, imageFormat );
How do I get GetContentType to return jpeg mimetype with jpg files?
The function GetContentType() should be returning the correct mime type. imageFormat is set to the RawFormat at the time the image is loaded. I stepped through the code and it appears to be working as expected.
If you wish to hard code all content types for the images to image/jpeg, you can modify getContentType() to always return "image/jpeg".
Hope that helps.
-KIRBY
When you right click on an image to save it from the browser it is always bmp in the 1.3 version I have installed.
Jan,
I found the problem. Using an HTTP Viewer I looked at the header for the images. The correct content-type was being returned. As a swag I turned off output cache for thumbnail.aspx. This now allows the save as dialog box to know what the real content type is. I find it strange that with output cache turned on that the save as box could not determine the content type even though it was specified in the HTTP header.
As an added bonus I now am setting the content-disposition to the file name so the user will get a default file name based on the original file name.
I'll get a new build out later today. And thanks for finding this problem!
-KIRBY