Fix dzsave_target
for ZIP output (#2927)
This commit is contained in:
parent
1bf1a32f2c
commit
d546c81fa3
@ -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
|
||||
|
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user