make pdfload header a proper vfunc

_buffer was not inheriting it correctly
This commit is contained in:
John Cupitt 2019-09-19 18:09:19 +01:00
parent 0323b77666
commit e16e4abeda
2 changed files with 20 additions and 7 deletions

View File

@ -1180,24 +1180,23 @@ vips_foreign_load_gif_class_init( VipsForeignLoadGifClass *class )
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;
VipsForeignLoadGifClass *gif_class = (VipsForeignLoadGifClass *) class;
gobject_class->dispose = vips_foreign_load_gif_dispose;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
gif_class->open = vips_foreign_load_gif_open;
gif_class->close = vips_foreign_load_gif_close;
load_class->header = vips_foreign_load_gif_header;
load_class->load = vips_foreign_load_gif_load;
object_class->nickname = "gifload_base";
object_class->description = _( "load GIF with giflib" );
load_class->header = vips_foreign_load_gif_header;
load_class->load = vips_foreign_load_gif_load;
load_class->get_flags_filename =
vips_foreign_load_gif_get_flags_filename;
load_class->get_flags = vips_foreign_load_gif_get_flags;
class->open = vips_foreign_load_gif_open;
class->close = vips_foreign_load_gif_close;
VIPS_ARG_INT( class, "page", 20,
_( "Page" ),
_( "Load this page from the file" ),

View File

@ -362,6 +362,10 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load )
static void
vips_foreign_load_pdf_minimise( VipsObject *object, VipsForeignLoadPdf *pdf )
{
#ifdef DEBUG
printf( "vips_foreign_load_pdf_minimise: %p\n", pdf );
#endif /*DEBUG*/
/* In seq mode, we can shut down the input at the end of computation.
*/
if( VIPS_FOREIGN_LOAD( pdf )->access == VIPS_ACCESS_SEQUENTIAL ) {
@ -500,6 +504,10 @@ vips_foreign_load_pdf_open( VipsForeignLoadPdf *pdf )
static void
vips_foreign_load_pdf_close( VipsForeignLoadPdf *pdf )
{
#ifdef DEBUG
printf( "vips_foreign_load_pdf_file_close:\n" );
#endif /*DEBUG*/
VIPS_UNREF( pdf->page );
VIPS_UNREF( pdf->doc );
}
@ -522,6 +530,7 @@ vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class )
load_class->get_flags_filename =
vips_foreign_load_pdf_get_flags_filename;
load_class->get_flags = vips_foreign_load_pdf_get_flags;
load_class->header = vips_foreign_load_pdf_header;
load_class->load = vips_foreign_load_pdf_load;
class->open = vips_foreign_load_pdf_open;
@ -609,7 +618,8 @@ vips_foreign_load_pdf_file_header( VipsForeignLoad *load )
VIPS_SETSTR( load->out->filename, file->filename );
return( vips_foreign_load_pdf_header( load ) );
return( VIPS_FOREIGN_LOAD_CLASS(
vips_foreign_load_pdf_file_parent_class )->header( load ) );
}
static const char *vips_foreign_pdf_suffs[] = {
@ -624,6 +634,10 @@ vips_foreign_load_pdf_file_open( VipsForeignLoadPdf *pdf )
GError *error = NULL;
#ifdef DEBUG
printf( "vips_foreign_load_pdf_file_open: %s\n", file->filename );
#endif /*DEBUG*/
if( !file->uri ) {
char *path;