diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 07:24:51 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 07:24:51 +0000 |
commit | 3c85c3bc2c2fe5e5d60438b127d99d5dc2248016 (patch) | |
tree | 07d8e20f5fdd0d75a12f99e9b0335d8d88afde85 /svtools | |
parent | 8430256209403b9c2c0a1b0c394b159debbf4f51 (diff) |
INTEGRATION: CWS pngperf (1.14.14); FILE MERGED
2006/08/14 16:14:50 hdu 1.14.14.3: RESYNC: (1.14-1.15); FILE MERGED
2005/10/14 12:54:50 hdu 1.14.14.2: #i55170# allow graphic import optimized for previews
2005/10/13 08:06:18 hdu 1.14.14.1: #i55170# implement fast JPEG preview
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/filter.vcl/jpeg/jpeg.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx index 6fa11295174d..a3c487f89ad5 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.cxx +++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx @@ -4,9 +4,9 @@ * * $RCSfile: jpeg.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: hr $ $Date: 2006-06-19 21:07:20 $ + * last change: $Author: vg $ $Date: 2006-09-08 08:24:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -315,7 +315,7 @@ extern "C" void jpeg_svstream_src (j_decompress_ptr cinfo, void * in) // - JPEGReader - // -------------- -JPEGReader::JPEGReader( SvStream& rStm, void*, sal_Bool bSetLS ) : +JPEGReader::JPEGReader( SvStream& rStm, void* /*pCallData*/, sal_Bool bSetLS ) : rIStm ( rStm ), pAcc ( NULL ), pAcc1 ( NULL ), @@ -537,13 +537,13 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) BOOL bRet = FALSE; BYTE cDummy; - // sehen, ob wir _alles_ lesen koennen +#if 1 // TODO: is it possible to get rid of this seek to the end? + // check if the stream's end is already available rIStm.Seek( STREAM_SEEK_TO_END ); rIStm >> cDummy; nEndPos = rIStm.Tell(); - // falls wir nicht alles lesen koennen, gucken wir, - // ob min. JPEGMINREAD Bytes gelesen werden koennen + // else check if at least JPEGMINREAD bytes can be read if( rIStm.GetError() == ERRCODE_IO_PENDING ) { rIStm.ResetError(); @@ -554,10 +554,14 @@ ReadState JPEGReader::Read( Graphic& rGraphic ) } } - // an Anfang springen + // seek back to the original position rIStm.Seek( nLastPos ); +#endif + + Size aPreviewSize = GetPreviewSize(); + SetJpegPreviewSizeHint( aPreviewSize.Width(), aPreviewSize.Height() ); - // (Teil-) Bild einlesen + // read the (partial) image ReadJPEG( this, &rIStm, &nLines ); if( pAcc ) @@ -730,6 +734,11 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 if( !pJPEGReader ) pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 ); + if( nImportFlags & GRFILTER_I_FLAGS_FOR_PREVIEW ) + pJPEGReader->SetPreviewSize( Size(128,128) ); + else + pJPEGReader->DisablePreviewMode(); + rGraphic.SetContext( NULL ); eReadState = pJPEGReader->Read( rGraphic ); |