Image Quality not enforced RRS feed

  • Question

  • User-845515816 posted
    Dim ImgCodecInfo() As ImageCodecInfo = ImageCodecInfo.GetImageEncoders Dim JPEGCodecInfo As ImageCodecInfo Dim x As Integer For Each JPEGCodecInfo In ImgCodecInfo If ImgCodecInfo(x).MimeType = "image/jpeg" Then Exit For End If Next Dim EncParam As New EncoderParameters(1) EncParam.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 50) thumbNailImg.Save(TumbPath, JPEGCodecInfo, EncParam) Whatever I put as the quality, 10, 50 100, 0.5; my file are always the same size. Is there somthing I'm not doing right ?
    Saturday, March 27, 2004 12:51 AM

All replies

  • User-865881720 posted
    As x never changes in your For Each loop, JPEGCodecInfo is always the last element (codec) in the enumeration of codec info. Since this is not the jpg codec, the quality setting is apparently ignored and your thumbnail file is probably not even a jpg. Try this: For Each JPEGCodecInfo In Imaging.ImageCodecInfo.GetImageEncoders If JPEGCodecInfo.MimeType = "image/jpeg" Then Exit For Next
    Saturday, March 27, 2004 7:37 AM
  • User-845515816 posted
    Thanks a lot, I knew it was some stupid things like that :)
    Saturday, March 27, 2004 11:04 AM