Hi,
I have made some changes to enable the image quality settings modifications, you can find the unofficial MonoX patch (4.1.2575) in the attachment.
To implement custom image quality settings you need to do the following:
1. Create your own upload handler by inheriting from
MonoSoftware.MonoX.SilverlightUploadHandler
2. Override the
SaveThumbnail method which will be called on every image upload in the MonoX
- here you can create or resize uploaded images
- existing code looks like this (MonoX version 4.1.2741):
protected
virtual
void
SaveThumbnail(
string
filePath, IFileContentProvider provider)
{
foreach
(ThumbnailSizeType item
in
Enum.GetValues(
typeof
(ThumbnailSizeType)))
{
Image thumbnail = ImageUtility.CreateThumbnail(filePath, (
int
)item);
try
{
using
(MemoryStream stream =
new
MemoryStream())
{
thumbnail.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
string
newFilePath = ImageUtility.GetThumbnailFileName(filePath, item);
provider.StoreFile(stream, newFilePath);
}
}
catch
{ }
finally
{
thumbnail.Dispose();
}
}
}
- as you can see we are pre-creating all the thumbnails and here you can use almost the same code as above but with small change, you need to call the
ImageUtility.CreateThumbnail with your custom image size. If you want to change the image resize quality settings then you can use method overload that has an
MonoSoftware.Core.Drawing.ImageFormatterEventArgs which exposes even more settings.
Regards