Hi, How GD Image in PHP can compress an existing image size on the fly? I ask for that, imagine in the case of making a photo gallery and you want to make a small preview or thumb nails for several images in a single page. so we need to compress their size to prevent getting a heavy and slow pages. Is this possible? and How? 😕
Well, unless you know how to write a compressor, you're not going to have much luck with this. PHP has no built-in file compressor.
You can, however, use imagecopyresized() to resize an image for a thumbnail.
does the meanning of resize is to change its dimensions i.e. width and height or its size in KB? However thank you for your valuable help and I will try this idea.🙂