test suite passes
with all jpegload coming via VipsStreamInput
This commit is contained in:
parent
6c1d7db31b
commit
20cb0da247
|
@ -16,6 +16,8 @@
|
|||
- add @interpretation and @format to rawload
|
||||
- nifti load/save uses double for all floating point metadata
|
||||
- add vips_error_buffer_copy()
|
||||
- add VipsStream ... a universal IO class for loaders and savers
|
||||
- jpegload uses the new IO class
|
||||
|
||||
31/8/19 started 8.8.3
|
||||
- revert sharpen restoring the input colourspace
|
||||
|
|
|
@ -250,6 +250,26 @@ stream_fill_input_buffer( j_decompress_ptr cinfo )
|
|||
return( TRUE );
|
||||
}
|
||||
|
||||
static void
|
||||
skip_input_data( j_decompress_ptr cinfo, long num_bytes )
|
||||
{
|
||||
Source *src = (Source *) cinfo->src;
|
||||
|
||||
if( num_bytes > 0 ) {
|
||||
while (num_bytes > (long) src->pub.bytes_in_buffer) {
|
||||
num_bytes -= (long) src->pub.bytes_in_buffer;
|
||||
(void) (*src->pub.fill_input_buffer) (cinfo);
|
||||
|
||||
/* note we assume that fill_input_buffer will never
|
||||
* return FALSE, so suspension need not be handled.
|
||||
*/
|
||||
}
|
||||
|
||||
src->pub.next_input_byte += (size_t) num_bytes;
|
||||
src->pub.bytes_in_buffer -= (size_t) num_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
readjpeg_open_input( ReadJpeg *jpeg )
|
||||
{
|
||||
|
@ -272,6 +292,7 @@ readjpeg_open_input( ReadJpeg *jpeg )
|
|||
src->pub.init_source = stream_init_source;
|
||||
src->pub.fill_input_buffer = stream_fill_input_buffer;
|
||||
src->pub.resync_to_restart = jpeg_resync_to_restart;
|
||||
src->pub.skip_input_data = skip_input_data;
|
||||
src->pub.bytes_in_buffer = 0;
|
||||
src->pub.next_input_byte = src->buf;
|
||||
}
|
||||
|
|
|
@ -197,8 +197,6 @@ vips_foreign_load_jpeg_stream_load( VipsForeignLoad *load )
|
|||
static gboolean
|
||||
vips_foreign_load_jpeg_stream_is_a( VipsStreamInput *input )
|
||||
{
|
||||
printf( "vips_foreign_load_jpeg_stream_is_a:\n" );
|
||||
|
||||
return( vips__isjpeg_stream( input ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -33,16 +33,19 @@
|
|||
|
||||
/* TODO
|
||||
*
|
||||
* - filename encoding
|
||||
* - memory output
|
||||
* - add mmapable descriptors
|
||||
* - add seekable descriptors
|
||||
* - can we test for mmapable and seekable?
|
||||
* - do we need eof?
|
||||
* - can we really change all behaviour in the subclass? will we need map and
|
||||
* seek as well as read and rewind?
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
#define VIPS_DEBUG
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
|
Loading…
Reference in New Issue