![]() ![]() The below example resizes the test.jpg image, using the numeric and percent coordinates and saves the new images into a file. Complex coordinates (are the combination of the above ones): $cropped = $image->crop('100%-70', '100%-50', 60, 40) Resizing an imageįor resizing an image using the WideImage library, we use the resize() method, with the following syntax: WideImage_Image resize(, ,, ) - Resize the image to given dimensions. ![]() Alignment labels: $cropped = $image->crop('center', 'center', 200, 250).Numeric coordinates: $resized = $image->resize(200, 100).They can be useful with any operation that requires coordinates as parameters, like resize, crop, etc. Smart coordinates were implemented to make operations that involve coordinates, dimensions, and positioning easier. Note: WideImage supports cross-format conversion you can easily load an image in one format, then save it in another: WideImage::load('file.jpg')->saveToFile('converted.png') Smart coordinates Parameters: mixed $source File name, url, HTML file input field name, binary string, or a GD image resource. This function checks the input and decides whether to use WideImage::loadFromHandle(), WideImage::loadFromFile(), WideImage::loadFromUpload() or WideImage::loadFromString(): ![]() Static WideImage_Image load( mixed $source) The load() method has the following syntax: Loading an imageīefore performing different operations on the images using the WideImage library, we need first to load an image – and for that we use the load() method that loads an image from a file, URL, HTML input file field, binary string, or a valid image handle. It also supports BMP (read/write) and TGA (read only). It requires PHP 5.2+ with GD2 extension WideImage supports all formats that are natively supported by the GD extension on the server (this currently includes GIF, PNG, JPG, GD, GD2, WBMP, XBM, XPM). ![]() WideImage is an object-oriented library for image manipulation that provides a simple way of loading, manipulating and saving images in the most common image formats. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |