Merge branch '8.10'

This commit is contained in:
John Cupitt 2021-04-30 08:27:32 +01:00
commit 56e0b2c2c8
4 changed files with 22 additions and 71 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
compile
.pytest_cache
.dirstamp
a.out
*.log
*.trs

View File

@ -28,6 +28,9 @@
- move openslide, libheif, poppler and magick to loadable modules [kleisauke]
- better detection of invalid ICC profiles, better fallback paths
30/4/21 start 8.10.7
- better vips7 PNG load compatibility [SkyDiverCool]
22/12/20 start 8.10.6
- don't seek on bad file descriptors [kleisauke]
- check for null memory sources [kleisauke]

View File

@ -2,7 +2,11 @@
# also update the version number in the m4 macros below
<<<<<<< HEAD
AC_INIT([vips], [8.11.0], [vipsip@jiscmail.ac.uk])
=======
AC_INIT([vips], [8.10.7], [vipsip@jiscmail.ac.uk])
>>>>>>> 8.10
# required for gobject-introspection
AC_PREREQ(2.62)

View File

@ -48,80 +48,24 @@
#include "../foreign/pforeign.h"
static int
png2vips( const char *name, IMAGE *out, gboolean header_only )
{
char filename[FILENAME_MAX];
char mode[FILENAME_MAX];
char *p, *q;
int seq;
im_filename_split( name, filename, mode );
seq = 0;
p = &mode[0];
if( (q = im_getnextoption( &p )) ) {
if( im_isprefix( "seq", q ) )
seq = 1;
}
/* We need to be compatible with the pre-sequential mode
* im_png2vips(). This returned a "t" if given a "p" image, since it
* used writeline.
*
* If we're writing the image to a "p", switch it to a "t".
*
* Don't do this for header read, since we don't want to force a
* malloc if all we are doing is looking at fields.
*/
if( !header_only &&
!seq &&
out->dtype == VIPS_IMAGE_PARTIAL ) {
if( vips__image_wio_output( out ) )
return( -1 );
}
/* spngload does not define these vips7 compat functions.
*/
#if defined(HAVE_PNG) && !defined(HAVE_SPNG)
{
VipsSource *source;
int result;
if( !(source = vips_source_new_from_file( filename )) )
return( -1 );
if( header_only )
result = vips__png_header_source( source, out );
else
result = vips__png_read_source( source, out, TRUE );
VIPS_UNREF( source );
if( result )
return( result );
}
#else
vips_error( "im_png2vips",
"%s", _( "no PNG support in your libvips" ) );
return( -1 );
#endif /*HAVE_PNG && !HAVE_SPNG*/
return( 0 );
}
int
im_png2vips( const char *name, IMAGE *out )
{
return( png2vips( name, out, FALSE ) );
}
char filename[FILENAME_MAX];
char mode[FILENAME_MAX];
VipsImage *x;
/* By having a separate header func, we get lazy.c to open via disc/mem.
*/
static int
im_png2vips_header( const char *name, IMAGE *out )
{
return( png2vips( name, out, TRUE ) );
im_filename_split( name, filename, mode );
if( vips_pngload( filename, &x, NULL ) )
return( -1 );
if( vips_image_write( x, out ) ) {
VIPS_UNREF( x );
return( -1 );
}
VIPS_UNREF( x );
return( 0 );
}
static int
@ -145,7 +89,6 @@ vips_format_png_class_init( VipsFormatPngClass *class )
object_class->description = _( "PNG" );
format_class->is_a = ispng;
format_class->header = im_png2vips_header;
format_class->load = im_png2vips;
format_class->save = im_vips2png;
format_class->suffs = png_suffs;