PHP Function Imagesy
php function imagesy is a built-in image-processing library that allows you to create, resize and print your web pages dynamically without the need for additional images files. It is bundled with PHP and should be active on most servers. To check if it is activated, you can run
The resize_image_force function checks to see if your image dimensions are within the maximum width or height and then resizes it. This is important because it maintains the aspect ratio of the image, but it also means that you may end up with a squished penguin (see example below).
mbstring is another built-in extension that can be used to parse and retrieve EXIF information from an image. This includes the image file type, width and height, attributes, created date and last modified date.
To retrieve the image properties, you need to pass the GD image object in as an argument to this function. You will need to use the same order of arguments as when passing in a variable or array – value or reference.
Remember that variables are passed by value unless you specify otherwise, and arrays are passed by reference. Be careful when using these extensions and always check the API documentation to ensure you understand how they work. It is important to know whether you are passing in a copy of an array or a reference to an array because the behaviour differs between them.