wxImage and jpeg file size question

Armel Asselin armelasselin at hotmail.com
Mon Sep 18 07:41:53 PDT 2006



"Thomas Zehbe" <tz at ingenion.de> a écrit dans le message de news: 
200609181550.09221.tz at ingenion.de...
> Hi,
> I use wxImage to load image files form Disk and show them on a canvas 
> creating
> a wxBitmap from them.
> To save the image in my PostgeSQL database I create an 
> wxMemoryOutputStream
> and call SaveFile
>        if (!img->SaveFile(stream, wxBITMAP_TYPE_JPEG)) return false;
> and aftwerwards
>        *m_size = stream.CopyTo((char*)m_value, pic->GetMaxSize());
> My test pictures a 4,1 Megapixel jpegs of about 1.6MB filesize taken with 
> a
> camera.
> Using SaveFile() leads to a buffer of no more than about 540k.
> This is the same size which results from using 
> SaveFile(_("filename.jpg")).
>
> Comparing original and copy using gwenview doesn't show any lack detail at
> first sight. Is the algorithm used to create a jpeg from wxImage so much 
> more
> effective? Or is it simply so that less quality is used during conversion?
your camera either uses something else than jpg or uses jpg with slightly 
eigher level of quality (leading to a lower compression)

Armel








More information about the wx-users mailing list