X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74e3313b2506b76b18ea1874cf9b835f11d7068a..a58d5df4ef7fbbbb1c385ac63038608d49f8dfa5:/src/common/imagjpeg.cpp diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index 07bc8934cb..04de921c97 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -10,10 +10,6 @@ /* We don't put pragma implement in this file because it is already present in src/common/image.cpp - -#ifdef __GNUG__ -#pragma implementation "image.h" -#endif */ // For compilers that support precompilation, includes "wx.h". @@ -23,16 +19,18 @@ #pragma hdrstop #endif +#include "wx/defs.h" + +#if wxUSE_LIBJPEG + #include "wx/image.h" #include "wx/bitmap.h" #include "wx/debug.h" #include "wx/log.h" #include "wx/app.h" -#if wxUSE_LIBJPEG -extern "C" { -#include "../jpeg/jpeglib.h" +extern "C" { +#include "jpeglib.h" } -#endif #include "wx/filefn.h" #include "wx/wfstream.h" #include "wx/intl.h" @@ -57,15 +55,12 @@ extern "C" { // wxJPEGHandler //----------------------------------------------------------------------------- -#if wxUSE_LIBJPEG - #if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxJPEGHandler,wxImageHandler) #endif #if wxUSE_STREAMS - //------------- JPEG Data Source Manager typedef struct { @@ -111,10 +106,10 @@ void jpeg_wxio_src( j_decompress_ptr cinfo, wxInputStream& infile ) src = (my_src_ptr) cinfo->src; } src = (my_src_ptr) cinfo->src; - src->pub.bytes_in_buffer = infile.StreamSize(); /* forces fill_input_buffer on first read */ - src->buffer = (JOCTET *) malloc (infile.StreamSize()); + src->pub.bytes_in_buffer = infile.GetSize(); /* forces fill_input_buffer on first read */ + src->buffer = (JOCTET *) malloc (infile.GetSize()); src->pub.next_input_byte = src->buffer; /* until buffer loaded */ - infile.Read(src->buffer, infile.StreamSize()); + infile.Read(src->buffer, infile.GetSize()); src->pub.init_source = my_init_source; src->pub.fill_input_buffer = my_fill_input_buffer; @@ -310,12 +305,12 @@ bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream ) return TRUE; } -#endif // wxUSE_STREAMS - -#endif -// wxUSE_LIBJPEG +#endif + // wxUSE_STREAMS +#endif + // wxUSE_LIBJPEG