Merge branch '8.10'
This commit is contained in:
commit
56e0b2c2c8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
compile
|
compile
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
|
.dirstamp
|
||||||
a.out
|
a.out
|
||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
- move openslide, libheif, poppler and magick to loadable modules [kleisauke]
|
- move openslide, libheif, poppler and magick to loadable modules [kleisauke]
|
||||||
- better detection of invalid ICC profiles, better fallback paths
|
- 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
|
22/12/20 start 8.10.6
|
||||||
- don't seek on bad file descriptors [kleisauke]
|
- don't seek on bad file descriptors [kleisauke]
|
||||||
- check for null memory sources [kleisauke]
|
- check for null memory sources [kleisauke]
|
||||||
|
@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
# also update the version number in the m4 macros below
|
# 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.11.0], [vipsip@jiscmail.ac.uk])
|
||||||
|
=======
|
||||||
|
AC_INIT([vips], [8.10.7], [vipsip@jiscmail.ac.uk])
|
||||||
|
>>>>>>> 8.10
|
||||||
# required for gobject-introspection
|
# required for gobject-introspection
|
||||||
AC_PREREQ(2.62)
|
AC_PREREQ(2.62)
|
||||||
|
|
||||||
|
@ -48,80 +48,24 @@
|
|||||||
|
|
||||||
#include "../foreign/pforeign.h"
|
#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
|
int
|
||||||
im_png2vips( const char *name, IMAGE *out )
|
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.
|
im_filename_split( name, filename, mode );
|
||||||
*/
|
|
||||||
static int
|
if( vips_pngload( filename, &x, NULL ) )
|
||||||
im_png2vips_header( const char *name, IMAGE *out )
|
return( -1 );
|
||||||
{
|
if( vips_image_write( x, out ) ) {
|
||||||
return( png2vips( name, out, TRUE ) );
|
VIPS_UNREF( x );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
VIPS_UNREF( x );
|
||||||
|
|
||||||
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -145,7 +89,6 @@ vips_format_png_class_init( VipsFormatPngClass *class )
|
|||||||
object_class->description = _( "PNG" );
|
object_class->description = _( "PNG" );
|
||||||
|
|
||||||
format_class->is_a = ispng;
|
format_class->is_a = ispng;
|
||||||
format_class->header = im_png2vips_header;
|
|
||||||
format_class->load = im_png2vips;
|
format_class->load = im_png2vips;
|
||||||
format_class->save = im_vips2png;
|
format_class->save = im_vips2png;
|
||||||
format_class->suffs = png_suffs;
|
format_class->suffs = png_suffs;
|
||||||
|
Loading…
Reference in New Issue
Block a user