Upgrade to libvips v8.7.0

Drop Node 4 support
Add experimental musl prebuild for Node 8 and 10
This commit is contained in:
Lovell Fuller
2018-09-19 21:38:09 +01:00
parent 4cff62258c
commit c8ff7e11a9
25 changed files with 500 additions and 411 deletions

View File

@@ -370,10 +370,6 @@ namespace sharp {
if (image.width() > 65535 || image.height() > 65535) {
throw vips::VError("Processed image is too large for the JPEG format");
}
} else if (imageType == ImageType::PNG) {
if (image.width() > 2147483647 || image.height() > 2147483647) {
throw vips::VError("Processed image is too large for the PNG format");
}
} else if (imageType == ImageType::WEBP) {
if (image.width() > 16383 || image.height() > 16383) {
throw vips::VError("Processed image is too large for the WebP format");

View File

@@ -613,7 +613,7 @@ VImage::new_matrixv( int width, int height, ... )
}
VImage
VImage::write( VImage out )
VImage::write( VImage out ) const
{
if( vips_image_write( this->get_image(), out.get_image() ) )
throw VError();
@@ -622,7 +622,7 @@ VImage::write( VImage out )
}
void
VImage::write_to_file( const char *name, VOption *options )
VImage::write_to_file( const char *name, VOption *options ) const
{
char filename[VIPS_PATH_MAX];
char option_string[VIPS_PATH_MAX];
@@ -642,7 +642,7 @@ VImage::write_to_file( const char *name, VOption *options )
void
VImage::write_to_buffer( const char *suffix, void **buf, size_t *size,
VOption *options )
VOption *options ) const
{
char filename[VIPS_PATH_MAX];
char option_string[VIPS_PATH_MAX];
@@ -675,7 +675,7 @@ VImage::write_to_buffer( const char *suffix, void **buf, size_t *size,
#include "vips-operators.cpp"
std::vector<VImage>
VImage::bandsplit( VOption *options )
VImage::bandsplit( VOption *options ) const
{
std::vector<VImage> b;
@@ -686,7 +686,7 @@ VImage::bandsplit( VOption *options )
}
VImage
VImage::bandjoin( VImage other, VOption *options )
VImage::bandjoin( VImage other, VOption *options ) const
{
VImage v[2] = { *this, other };
std::vector<VImage> vec( v, v + VIPS_NUMBER( v ) );
@@ -695,7 +695,7 @@ VImage::bandjoin( VImage other, VOption *options )
}
VImage
VImage::composite( VImage other, VipsBlendMode mode, VOption *options )
VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) const
{
VImage v[2] = { *this, other };
std::vector<VImage> ivec( v, v + VIPS_NUMBER( v ) );
@@ -706,7 +706,7 @@ VImage::composite( VImage other, VipsBlendMode mode, VOption *options )
}
std::complex<double>
VImage::minpos( VOption *options )
VImage::minpos( VOption *options ) const
{
double x, y;
@@ -719,7 +719,7 @@ VImage::minpos( VOption *options )
}
std::complex<double>
VImage::maxpos( VOption *options )
VImage::maxpos( VOption *options ) const
{
double x, y;
@@ -734,43 +734,43 @@ VImage::maxpos( VOption *options )
// Operator overloads
VImage
VImage::operator[]( int index )
VImage::operator[]( int index ) const
{
return( this->extract_band( index ) );
}
std::vector<double>
VImage::operator()( int x, int y )
VImage::operator()( int x, int y ) const
{
return( this->getpoint( x, y ) );
}
VImage
operator+( VImage a, VImage b )
operator+( const VImage a, const VImage b )
{
return( a.add( b ) );
}
VImage
operator+( double a, VImage b )
operator+( double a, const VImage b )
{
return( b.linear( 1.0, a ) );
}
VImage
operator+( VImage a, double b )
operator+( const VImage a, double b )
{
return( a.linear( 1.0, b ) );
}
VImage
operator+( std::vector<double> a, VImage b )
operator+( const std::vector<double> a, const VImage b )
{
return( b.linear( 1.0, a ) );
}
VImage
operator+( VImage a, std::vector<double> b )
operator+( const VImage a, const std::vector<double> b )
{
return( a.linear( 1.0, b ) );
}
@@ -788,37 +788,37 @@ operator+=( VImage &a, const double b )
}
VImage &
operator+=( VImage &a, std::vector<double> b )
operator+=( VImage &a, const std::vector<double> b )
{
return( a = a + b );
}
VImage
operator-( VImage a, VImage b )
operator-( const VImage a, const VImage b )
{
return( a.subtract( b ) );
}
VImage
operator-( double a, VImage b )
operator-( double a, const VImage b )
{
return( b.linear( -1.0, a ) );
}
VImage
operator-( VImage a, double b )
operator-( const VImage a, double b )
{
return( a.linear( 1.0, -b ) );
}
VImage
operator-( std::vector<double> a, VImage b )
operator-( const std::vector<double> a, const VImage b )
{
return( b.linear( -1.0, a ) );
}
VImage
operator-( VImage a, std::vector<double> b )
operator-( const VImage a, const std::vector<double> b )
{
return( a.linear( 1.0, vips::negate( b ) ) );
}
@@ -836,43 +836,43 @@ operator-=( VImage &a, const double b )
}
VImage &
operator-=( VImage &a, std::vector<double> b )
operator-=( VImage &a, const std::vector<double> b )
{
return( a = a - b );
}
VImage
operator-( VImage a )
operator-( const VImage a )
{
return( a * -1 );
}
VImage
operator*( VImage a, VImage b )
operator*( const VImage a, const VImage b )
{
return( a.multiply( b ) );
}
VImage
operator*( double a, VImage b )
operator*( double a, const VImage b )
{
return( b.linear( a, 0.0 ) );
}
VImage
operator*( VImage a, double b )
operator*( const VImage a, double b )
{
return( a.linear( b, 0.0 ) );
}
VImage
operator*( std::vector<double> a, VImage b )
operator*( const std::vector<double> a, const VImage b )
{
return( b.linear( a, 0.0 ) );
}
VImage
operator*( VImage a, std::vector<double> b )
operator*( const VImage a, const std::vector<double> b )
{
return( a.linear( b, 0.0 ) );
}
@@ -890,37 +890,37 @@ operator*=( VImage &a, const double b )
}
VImage &
operator*=( VImage &a, std::vector<double> b )
operator*=( VImage &a, const std::vector<double> b )
{
return( a = a * b );
}
VImage
operator/( VImage a, VImage b )
operator/( const VImage a, const VImage b )
{
return( a.divide( b ) );
}
VImage
operator/( double a, VImage b )
operator/( double a, const VImage b )
{
return( b.pow( -1.0 ).linear( a, 0.0 ) );
}
VImage
operator/( VImage a, double b )
operator/( const VImage a, double b )
{
return( a.linear( 1.0 / b, 0.0 ) );
}
VImage
operator/( std::vector<double> a, VImage b )
operator/( const std::vector<double> a, const VImage b )
{
return( b.pow( -1.0 ).linear( a, 0.0 ) );
}
VImage
operator/( VImage a, std::vector<double> b )
operator/( const VImage a, const std::vector<double> b )
{
return( a.linear( vips::invert( b ), 0.0 ) );
}
@@ -938,25 +938,25 @@ operator/=( VImage &a, const double b )
}
VImage &
operator/=( VImage &a, std::vector<double> b )
operator/=( VImage &a, const std::vector<double> b )
{
return( a = a / b );
}
VImage
operator%( VImage a, VImage b )
operator%( const VImage a, const VImage b )
{
return( a.remainder( b ) );
}
VImage
operator%( VImage a, double b )
operator%( const VImage a, const double b )
{
return( a.remainder_const( to_vector( b ) ) );
}
VImage
operator%( VImage a, std::vector<double> b )
operator%( const VImage a, const std::vector<double> b )
{
return( a.remainder_const( b ) );
}
@@ -974,243 +974,243 @@ operator%=( VImage &a, const double b )
}
VImage &
operator%=( VImage &a, std::vector<double> b )
operator%=( VImage &a, const std::vector<double> b )
{
return( a = a % b );
}
VImage
operator<( VImage a, VImage b )
operator<( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESS ) );
}
VImage
operator<( double a, VImage b )
operator<( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
to_vector( a ) ) );
}
VImage
operator<( VImage a, double b )
operator<( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
to_vector( b ) ) );
}
VImage
operator<( std::vector<double> a, VImage b )
operator<( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
a ) );
}
VImage
operator<( VImage a, std::vector<double> b )
operator<( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
b ) );
}
VImage
operator<=( VImage a, VImage b )
operator<=( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESSEQ ) );
}
VImage
operator<=( double a, VImage b )
operator<=( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
to_vector( a ) ) );
}
VImage
operator<=( VImage a, double b )
operator<=( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
to_vector( b ) ) );
}
VImage
operator<=( std::vector<double> a, VImage b )
operator<=( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
a ) );
}
VImage
operator<=( VImage a, std::vector<double> b )
operator<=( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
b ) );
}
VImage
operator>( VImage a, VImage b )
operator>( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_MORE ) );
}
VImage
operator>( double a, VImage b )
operator>( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
to_vector( a ) ) );
}
VImage
operator>( VImage a, double b )
operator>( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
to_vector( b ) ) );
}
VImage
operator>( std::vector<double> a, VImage b )
operator>( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
a ) );
}
VImage
operator>( VImage a, std::vector<double> b )
operator>( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
b ) );
}
VImage
operator>=( VImage a, VImage b )
operator>=( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_MOREEQ ) );
}
VImage
operator>=( double a, VImage b )
operator>=( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
to_vector( a ) ) );
}
VImage
operator>=( VImage a, double b )
operator>=( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
to_vector( b ) ) );
}
VImage
operator>=( std::vector<double> a, VImage b )
operator>=( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
a ) );
}
VImage
operator>=( VImage a, std::vector<double> b )
operator>=( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
b ) );
}
VImage
operator==( VImage a, VImage b )
operator==( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_EQUAL ) );
}
VImage
operator==( double a, VImage b )
operator==( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
to_vector( a ) ) );
}
VImage
operator==( VImage a, double b )
operator==( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
to_vector( b ) ) );
}
VImage
operator==( std::vector<double> a, VImage b )
operator==( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
a ) );
}
VImage
operator==( VImage a, std::vector<double> b )
operator==( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
b ) );
}
VImage
operator!=( VImage a, VImage b )
operator!=( const VImage a, const VImage b )
{
return( a.relational( b, VIPS_OPERATION_RELATIONAL_NOTEQ ) );
}
VImage
operator!=( double a, VImage b )
operator!=( const double a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
to_vector( a ) ) );
}
VImage
operator!=( VImage a, double b )
operator!=( const VImage a, const double b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
to_vector( b ) ) );
}
VImage
operator!=( std::vector<double> a, VImage b )
operator!=( const std::vector<double> a, const VImage b )
{
return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
a ) );
}
VImage
operator!=( VImage a, std::vector<double> b )
operator!=( const VImage a, const std::vector<double> b )
{
return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
b ) );
}
VImage
operator&( VImage a, VImage b )
operator&( const VImage a, const VImage b )
{
return( a.boolean( b, VIPS_OPERATION_BOOLEAN_AND ) );
}
VImage
operator&( double a, VImage b )
operator&( const double a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND,
to_vector( a ) ) );
}
VImage
operator&( VImage a, double b )
operator&( const VImage a, const double b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND,
to_vector( b ) ) );
}
VImage
operator&( std::vector<double> a, VImage b )
operator&( const std::vector<double> a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, a ) );
}
VImage
operator&( VImage a, std::vector<double> b )
operator&( const VImage a, const std::vector<double> b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, b ) );
}
@@ -1228,40 +1228,40 @@ operator&=( VImage &a, const double b )
}
VImage &
operator&=( VImage &a, std::vector<double> b )
operator&=( VImage &a, const std::vector<double> b )
{
return( a = a & b );
}
VImage
operator|( VImage a, VImage b )
operator|( const VImage a, const VImage b )
{
return( a.boolean( b, VIPS_OPERATION_BOOLEAN_OR ) );
}
VImage
operator|( double a, VImage b )
operator|( const double a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
to_vector( a ) ) );
}
VImage
operator|( VImage a, double b )
operator|( const VImage a, const double b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
to_vector( b ) ) );
}
VImage
operator|( std::vector<double> a, VImage b )
operator|( const std::vector<double> a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
a ) );
}
VImage
operator|( VImage a, std::vector<double> b )
operator|( const VImage a, const std::vector<double> b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
b ) );
@@ -1280,40 +1280,40 @@ operator|=( VImage &a, const double b )
}
VImage &
operator|=( VImage &a, std::vector<double> b )
operator|=( VImage &a, const std::vector<double> b )
{
return( a = a | b );
}
VImage
operator^( VImage a, VImage b )
operator^( const VImage a, const VImage b )
{
return( a.boolean( b, VIPS_OPERATION_BOOLEAN_EOR ) );
}
VImage
operator^( double a, VImage b )
operator^( const double a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
to_vector( a ) ) );
}
VImage
operator^( VImage a, double b )
operator^( const VImage a, const double b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
to_vector( b ) ) );
}
VImage
operator^( std::vector<double> a, VImage b )
operator^( const std::vector<double> a, const VImage b )
{
return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
a ) );
}
VImage
operator^( VImage a, std::vector<double> b )
operator^( const VImage a, const std::vector<double> b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
b ) );
@@ -1332,26 +1332,26 @@ operator^=( VImage &a, const double b )
}
VImage &
operator^=( VImage &a, std::vector<double> b )
operator^=( VImage &a, const std::vector<double> b )
{
return( a = a ^ b );
}
VImage
operator<<( VImage a, VImage b )
operator<<( const VImage a, const VImage b )
{
return( a.boolean( b, VIPS_OPERATION_BOOLEAN_LSHIFT ) );
}
VImage
operator<<( VImage a, double b )
operator<<( const VImage a, const double b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT,
to_vector( b ) ) );
}
VImage
operator<<( VImage a, std::vector<double> b )
operator<<( const VImage a, const std::vector<double> b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT,
b ) );
@@ -1370,26 +1370,26 @@ operator<<=( VImage &a, const double b )
}
VImage &
operator<<=( VImage &a, std::vector<double> b )
operator<<=( VImage &a, const std::vector<double> b )
{
return( a = a << b );
}
VImage
operator>>( VImage a, VImage b )
operator>>( const VImage a, const VImage b )
{
return( a.boolean( b, VIPS_OPERATION_BOOLEAN_RSHIFT ) );
}
VImage
operator>>( VImage a, double b )
operator>>( const VImage a, const double b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT,
to_vector( b ) ) );
}
VImage
operator>>( VImage a, std::vector<double> b )
operator>>( const VImage a, const std::vector<double> b )
{
return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT,
b ) );
@@ -1408,7 +1408,7 @@ operator>>=( VImage &a, const double b )
}
VImage &
operator>>=( VImage &a, std::vector<double> b )
operator>>=( VImage &a, const std::vector<double> b )
{
return( a = a << b );
}

File diff suppressed because it is too large Load Diff

View File

@@ -894,10 +894,6 @@ class PipelineWorker : public Nan::AsyncWorker {
if (baton->tiffCompression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG) {
sharp::AssertImageTypeDimensions(image, ImageType::JPEG);
}
// Cast pixel values to float, if required
if (baton->tiffPredictor == VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT) {
image = image.cast(VIPS_FORMAT_FLOAT);
}
image.tiffsave(const_cast<char*>(baton->fileOut.data()), VImage::option()
->set("strip", !baton->withMetadata)
->set("Q", baton->tiffQuality)

View File

@@ -259,7 +259,7 @@ NAN_METHOD(_maxColourDistance) {
}
// Calculate colour distance
maxColourDistance = image1.dE00(image2).max();
} catch (VError err) {
} catch (VError const &err) {
return ThrowError(err.what());
}