A simple PHP class for scaling images, keeping the aspect ratio intact.
Problem: Scale images of varying dimensions to fit within a pre-defined frame with fixed dimensions.
Uses:
- Include the class using PHP include.
- Create an object of the class and pass the name of the image file, width and height of the frame to fit in the scaled image.
- Call the scale image method.
- Save image at the desired location in the desired file format with the desired output image quality.