set filename on file read for more types

the new loaders were missing the line to set the output filename, so
`vipsheader fred.pdf` was not displaying the filename correctly
This commit is contained in:
John Cupitt 2016-06-01 09:14:01 +01:00
parent 0012cefc25
commit 916e5b5589
6 changed files with 8 additions and 16 deletions

14
TODO
View File

@ -1,23 +1,9 @@
- try:
$ vipsheader blankpage.pdf
temp-0: 595x842 uchar, 4 bands, srgb, pdfload
filename is not set?
try other files in test/images
- try adding a coz progress point to vipsthumbnail's main loop
see
https://github.com/plasma-umass/coz
- tiff write does not support [strip]
- add more webp tests to py suite

View File

@ -605,6 +605,8 @@ vips_foreign_load_gif_file_header( VipsForeignLoad *load )
if( vips_foreign_load_gif_open( gif, file->filename ) )
return( -1 );
VIPS_SETSTR( load->out->filename, file->filename );
return( vips_foreign_load_gif_header( load ) );
}

View File

@ -1174,6 +1174,8 @@ vips__jpeg_read_file( const char *filename, VipsImage *out,
if( vips__jpeg_read( jpeg, out, header_only ) )
return( -1 );
VIPS_SETSTR( out->filename, filename );
/* We can kill off the decompress early if this is just a header read.
* This saves an fd during read.
*/

View File

@ -204,8 +204,6 @@ vips_foreign_load_jpeg_file_header( VipsForeignLoad *load )
TRUE, jpeg->shrink, jpeg->fail, FALSE, jpeg->autorotate ) )
return( -1 );
VIPS_SETSTR( load->out->filename, file->filename );
return( 0 );
}

View File

@ -543,6 +543,8 @@ vips_foreign_load_pdf_file_header( VipsForeignLoad *load )
return( -1 );
}
VIPS_SETSTR( load->out->filename, file->filename );
return( vips_foreign_load_pdf_header( load ) );
}

View File

@ -308,6 +308,8 @@ vips_foreign_load_svg_file_header( VipsForeignLoad *load )
return( -1 );
}
VIPS_SETSTR( load->out->filename, file->filename );
return( vips_foreign_load_svg_header( load ) );
}