简体   繁体   中英

How to resize an image to a smaller size in codeigniter for a single Image upload?

I want to resize the images during upload to a small size so that they take less time while loading on the website.

And I also want to maintain the aspect ratio so that a portrait image doesn't get stretched and a landscape image doesn't get squeezed.That is without changing the actual dimensions of the image.

First convert your images to Jpeg, gif and png images as these are compressed images.

In addition you can use ImageMagick to compress the image: Recommendation for compressing JPG files with ImageMagick

An Image Manipulation class exists in CodeIgniter and can solve Your problem. Just read the official guide to learn more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM