diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index 8ebd3cec..0a04810e 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -248,9 +248,30 @@ gsf_output_target_write( GsfOutput *output, static gboolean gsf_output_target_seek( GsfOutput *output, gsf_off_t offset, GSeekType whence ) { +#ifdef HAVE_GSF_ZIP64 + /* No seek needed. + */ + return( FALSE ); +#else + GsfOutputTarget *output_target = (GsfOutputTarget *) output; + int stdio_whence; + + switch( whence ) { + case G_SEEK_CUR: stdio_whence = SEEK_CUR; break; + case G_SEEK_END: stdio_whence = SEEK_END; break; + case G_SEEK_SET: stdio_whence = SEEK_SET; break; + default: + g_assert_not_reached(); + } + + if( vips_target_seek( output_target->target, + offset, stdio_whence ) == -1 ) + return( FALSE ); + /* This will make our parent class handle the seek. */ return( TRUE ); +#endif } static void diff --git a/libvips/iofuncs/target.c b/libvips/iofuncs/target.c index 995b1e0e..2cc1f2fe 100644 --- a/libvips/iofuncs/target.c +++ b/libvips/iofuncs/target.c @@ -569,7 +569,7 @@ vips_target_read( VipsTarget *target, void *buffer, size_t length ) * Seeking a target sounds weird, but libtiff needs this. This method will * fail for targets like pipes. * - * Returns: 0 on success, -1 on error. + * Returns: the new seek position, -1 on error. */ off_t vips_target_seek( VipsTarget *target, off_t position, int whence )