diff --git a/libvips/format/.radiance.c.swp b/libvips/format/.radiance.c.swp new file mode 100644 index 00000000..6a558149 Binary files /dev/null and b/libvips/format/.radiance.c.swp differ diff --git a/libvips/format/im_jpeg2vips.c b/libvips/format/im_jpeg2vips.c index 2c4ec26d..6042cc2e 100644 --- a/libvips/format/im_jpeg2vips.c +++ b/libvips/format/im_jpeg2vips.c @@ -700,7 +700,7 @@ jpeg2vips( const char *name, IMAGE *out, gboolean header_only ) /* Make input. */ - if( !(fp = im__file_open_read( filename, NULL )) ) + if( !(fp = im__file_open_read( filename, NULL, FALSE )) ) return( -1 ); eman.fp = fp; jpeg_stdio_src( &cinfo, fp ); diff --git a/libvips/format/im_png2vips.c b/libvips/format/im_png2vips.c index de311442..e459bc58 100644 --- a/libvips/format/im_png2vips.c +++ b/libvips/format/im_png2vips.c @@ -140,7 +140,7 @@ read_new( const char *name, IMAGE *out ) read->row_pointer = NULL; read->data = NULL; - if( !(read->fp = im__file_open_read( name, NULL )) ) { + if( !(read->fp = im__file_open_read( name, NULL, FALSE )) ) { read_destroy( read ); return( NULL ); } diff --git a/libvips/format/im_ppm2vips.c b/libvips/format/im_ppm2vips.c index ae61e985..aba1b102 100644 --- a/libvips/format/im_ppm2vips.c +++ b/libvips/format/im_ppm2vips.c @@ -419,7 +419,7 @@ ppm2vips_header( const char *filename, IMAGE *out ) int ascii; int msb_first; - if( !(fp = im__file_open_read( filename, NULL )) ) + if( !(fp = im__file_open_read( filename, NULL, FALSE )) ) return( -1 ); if( read_header( fp, out, &bits, &ascii, &msb_first ) ) { fclose( fp ); @@ -442,7 +442,7 @@ isppmmmap( const char *filename ) int ascii; int msb_first; - if( !(fp = im__file_open_read( filename, NULL )) ) + if( !(fp = im__file_open_read( filename, NULL, FALSE )) ) return( -1 ); if( !(im = im_open( "temp", "p" )) ) { @@ -481,7 +481,10 @@ im_ppm2vips( const char *filename, IMAGE *out ) { FILE *fp; - if( !(fp = im__file_open_read( filename, NULL )) ) + /* Note that we open in binary mode. If this is a binary PPM, we need + * to be able to mmap it. + */ + if( !(fp = im__file_open_read( filename, NULL, FALSE )) ) return( -1 ); if( parse_ppm( fp, filename, out ) ) { fclose( fp ); diff --git a/libvips/format/im_vips2jpeg.c b/libvips/format/im_vips2jpeg.c index fbb7647b..6a55b97c 100644 --- a/libvips/format/im_vips2jpeg.c +++ b/libvips/format/im_vips2jpeg.c @@ -755,7 +755,7 @@ im_vips2jpeg( IMAGE *in, const char *filename ) /* Make output. */ - if( !(write->eman.fp = im__file_open_write( name )) ) { + if( !(write->eman.fp = im__file_open_write( name, FALSE )) ) { write_destroy( write ); return( -1 ); } diff --git a/libvips/format/im_vips2png.c b/libvips/format/im_vips2png.c index b8076bad..9b0e78d5 100644 --- a/libvips/format/im_vips2png.c +++ b/libvips/format/im_vips2png.c @@ -370,7 +370,7 @@ im_vips2png( IMAGE *in, const char *filename ) /* Make output. */ - if( !(write->fp = im__file_open_write( name )) ) { + if( !(write->fp = im__file_open_write( name, FALSE )) ) { write_destroy( write ); return( -1 ); } diff --git a/libvips/format/im_vips2ppm.c b/libvips/format/im_vips2ppm.c index f869ab62..c89e53a9 100644 --- a/libvips/format/im_vips2ppm.c +++ b/libvips/format/im_vips2ppm.c @@ -87,7 +87,7 @@ write_new( IMAGE *in, const char *name ) write->in = in; write->name = im_strdup( NULL, name ); - write->fp = im__file_open_write( name ); + write->fp = im__file_open_write( name, FALSE ); if( !write->name || !write->fp ) { write_destroy( write ); diff --git a/libvips/format/radiance.c b/libvips/format/radiance.c index d1a7d57c..4ea230e0 100644 --- a/libvips/format/radiance.c +++ b/libvips/format/radiance.c @@ -779,7 +779,7 @@ israd( const char *filename ) printf( "israd: \"%s\"\n", filename ); #endif /*DEBUG*/ - if( !(fin = im__file_open_read( filename, NULL )) ) + if( !(fin = im__file_open_read( filename, NULL, FALSE )) ) return( 0 ); strcpy( format, PICFMT ); result = checkheader( fin, format, NULL ); @@ -825,7 +825,7 @@ read_new( const char *filename, IMAGE *out ) read->prims[3][1] = CIE_y_w; read->buf = NULL; - if( !(read->fin = im__file_open_read( filename, NULL )) ) { + if( !(read->fin = im__file_open_read( filename, NULL, FALSE )) ) { read_destroy( read ); return( NULL ); } @@ -1052,7 +1052,7 @@ write_new( IMAGE *in, const char *filename ) write->in = in; write->filename = im_strdup( NULL, filename ); - write->fout = im__file_open_write( filename ); + write->fout = im__file_open_write( filename, FALSE ); strcpy( write->format, COLRFMT ); write->expos = 1.0; for( i = 0; i < 3; i++ ) diff --git a/libvips/mask/rw_mask.c b/libvips/mask/rw_mask.c index a0cd43c0..e25c6459 100644 --- a/libvips/mask/rw_mask.c +++ b/libvips/mask/rw_mask.c @@ -482,7 +482,7 @@ im_read_dmask( const char *filename ) int x, y, i, size; char buf[IM_MAX_LINE]; - if( !(fp = im__file_open_read( filename, NULL )) ) + if( !(fp = im__file_open_read( filename, NULL, TRUE )) ) return( NULL ); if( read_header( fp, &xs, &ys, &sc, &off ) ) {