Image processing in thinkphp

Source: Internet
Author: User
Foreach ($ info as $ file ){
$ Cc = $ data ['IMG '] = $ file ['savename'];
Echo basename ('./Uploads/42.jpg', '.jpg ');

$ Image-> open ('./Uploads/image name .jpg ');
$ Image-> thumb (150,150)-> save ('./Uploads/image name .jpg ');
$ User = M ("User ");
$ User-> where ("id = '{$ aa}'")-> save ($ data );
$ This-> success ('upload succeeded ', 'CC ');

I want to modify the uploaded image. I don't know what to write at the image name position.


Reply to discussion (solution)

Open the source image, $ file ['savename']
As for the name of the thumbnail, simply add a word or write a common function after it, and generate it based on the source image file name.

Open the source image, $ file ['savename']
As for the name of the thumbnail, simply add a word or write a common function after it, and generate it based on the source image file name.




$ Image-> open ('./Uploads/your filepath 'savename'0000.jpg'); does that mean this?

$ Bb = $ file ['savepath']. $ file ['savename'];
$ Image-> open ($ bb );
$ Image-> thumb (150,150, \ Think \ Image: IMAGE_THUMB_CENTER)-> save ($ bb );
Finally, this solves the problem...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.