2017-08-14 7.0.6-7 Cristy <quetzlzacatenango@image...>
* Fixed numerous memory leaks (reference
https://github.com/ImageMagick/ImageMagick/issues).
+ * Support splin16, spline36, and spline64 resize filters (reference
+ https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=32506).
+ * Prevent assertion failure when creating PDF thumbnail (reference
+ https://github.com/ImageMagick/ImageMagick/issues/674).
2017-08-12 7.0.6-7 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.6-7, GIT revision 20799:0db4d8a16:20170812.
{ "Sinc", SincFilter, UndefinedOptionFlag, MagickFalse },
{ "SincFast", SincFastFilter, UndefinedOptionFlag, MagickFalse },
{ "Spline", SplineFilter, UndefinedOptionFlag, MagickFalse },
+ { "Spline16", Spline16Filter, UndefinedOptionFlag, MagickFalse },
+ { "Spline36", Spline36Filter, UndefinedOptionFlag, MagickFalse },
+ { "Spline64", Spline64Filter, UndefinedOptionFlag, MagickFalse },
{ "Triangle", TriangleFilter, UndefinedOptionFlag, MagickFalse },
{ "Welch", WelchFilter, UndefinedOptionFlag, MagickFalse },
{ "Welsh", WelchFilter, UndefinedOptionFlag, MagickTrue }, /*misspell*/
}
}
+static double Spline16(const double x,
+ const ResizeFilter *magick_unused(resize_filter))
+{
+ /*
+ 2-lobe Spline filter.
+ */
+ if (x < 1.0)
+ return(((x-9.0/5.0 )*x-1.0/5.0)*x+1.0);
+ if (x < 2.0)
+ return(((-1.0/3.0*(x-1.0)+4.0/5.0)*(x-1.0)-7.0/15.0)*(x-1.0));
+ return(0.0);
+}
+
+static double Spline36(const double x,
+ const ResizeFilter *magick_unused(resize_filter))
+{
+ /*
+ 3-lobe Spline filter.
+ */
+ if (x < 1.0)
+ return(((13.0/11.0*x-453.0/209.0)*x-3.0/209.0)*x+1.0);
+ if (x < 2.0)
+ return(((-6.0/11.0*(x-1.0)+270.0/209.0)*(x-1.0)-156.0/209.0)*(x-1.0));
+ if (x < 3.0)
+ return(((1.0/11.0*(x-2.0)-45.0/209.0)*(x-2.0)+26.0/209.0)*(x-2.0));
+ return(0.0);
+}
+
+static double Spline64(const double x,
+ const ResizeFilter *magick_unused(resize_filter))
+{
+ /*
+ 4-lobe Spline filter.
+ */
+ if (x < 1.0)
+ return(((49.0/41.0*x-6387.0/2911.0)*x-3.0/2911.0)*x+1.0);
+ if (x < 2.0)
+ return(((-24.0/41.0*(x-1.0)+4032.0/2911.0)*(x-1.0)-2328.0/2911.0)*(x-1.0));
+ if (x < 3.0)
+ return(((6.0/41.0*(x-2.0)-1008.0/2911.0)*(x-2.0)+582.0/2911.0)*(x-2.0));
+ if (x < 4.0)
+ return(((-1.0/41.0*(x-3.0)+168.0/2911.0)*(x-3.0)-97.0/2911.0)*(x-3.0));
+ return(0.0);
+}
+
static double Triangle(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
{ LanczosFilter, CosineFilter }, /* Cosine window (3 lobes) */
{ SplineFilter, BoxFilter }, /* Spline Cubic Filter */
{ LanczosRadiusFilter, LanczosFilter }, /* Lanczos with integer radius */
+ { Spline16Filter, BoxFilter }, /* Spline 16 (2 lobes) */
+ { Spline36Filter, BoxFilter }, /* Spline 36 (3 lobes) */
+ { Spline16Filter, BoxFilter }, /* Spline 64 (4 lobes) */
};
/*
Table mapping the filter/window from the above table to an actual function.
{ Cosine, 1.0, 1.0, 0.0, 0.0, CosineWeightingFunction }, /* Low level cosine window */
{ CubicBC, 2.0, 2.0, 1.0, 0.0, CubicBCWeightingFunction }, /* Cubic B-Spline (B=1,C=0) */
{ SincFast, 3.0, 1.0, 0.0, 0.0, SincFastWeightingFunction }, /* Lanczos, Interger Radius */
+ { Spline16, 2.0, 2.0, 1.0, 0.0, CubicBCWeightingFunction }, /* Spline 16 2-lobed */
+ { Spline36, 3.0, 2.0, 1.0, 0.0, CubicBCWeightingFunction }, /* Spline 36 3-lobed */
+ { Spline64, 4.0, 2.0, 1.0, 0.0, CubicBCWeightingFunction }, /* Spline 64 4-lobed */
};
/*
The known zero crossings of the Jinc() or more accurately the Jinc(x*PI)