gd_resize - Resizes a GD image.
gd_resize (gdsrc:variable, gddst:variable, srcx:integer, srcy:integer, srcw:integer, srch:integer, dstx:integer,dsty:integer,dstw:integer,dsth:integer, transparent:"string", bgcolor:"string",pourc:float, truecolor:true|false);
This function is used to resize a GD image.
gd_resize really creates a new image if gddst is not specified, so it returns the new GD structure. The old GD structure is still valid. gd_free must be call with this new GD structure.
pourc and dw,dh are mutually exclusive.
gd_resize can also be called as gd_resampled which interpolates pixel.
To use this module, you must specify the following in /usr/local/website/site.conf:
Module gd { Library : "/usr/local/lib/libsngd.so" Init : "sngd_init" }
res=<{ remove("/html/images/resize1.gif"); remove("/html/images/resize2.gif"); remove("/html/images/resize3.gif"); im=gd_new(width:1000,height:1000,bgcolor:"#0000f0",truecolor:true); im2=gd_new(filename:"/html/images/20130708-1944-londres.jpg",truecolor:true); im3=gd_new(width:1000,height:1000,bgcolor:"#0000f0",truecolor:true); gd_resize(gdsrc:im2,gddst:im,dstx:50,dsty:50, dstw:800, dsth:800); gd_resampled(gdsrc:im2,gddst:im3,dstx:50,dsty:50, dstw:800, dsth:800); gd_write(gd:im,format:"gif",filename:"/html/images/resize1.gif"); gd_write(gd:im2,format:"gif",filename:"/html/images/resize2.gif"); gd_write(gd:im3,format:"gif",filename:"/html/images/resize3.gif"); gd_free(im); gd_free(im2); gd_free(im3);
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com