Question About CI uploading images (generating scaling and adding watermarks)

Source: Internet
Author: User
Refer to the following methods for uploading images and generating thumbnails and adding watermarks by using CI on the Internet.

The first step is to upload the original image and set the file name to 123.jpg.
Step 2: Use the uploaded image 123.jpg to generate a picture 23_t.jpg
Step 3: Add a watermark on the watermark 23_t.jpg

The server with 123.jpg 123_t.jpg at the end

I want to know if I can directly use abc.jpg to generate a thumbnail before uploading abc.jpg in the first step? (The reason is that you do not want to upload the source image or delete the file after uploading it)
Step 3 and Step 2 cannot be fully merged. Why do I need to scale down and add a watermark at the same time with 123.jpg?

Reply content:

The following describes how to upload images and generate thumbnails and watermarks using CI on the Internet:

The first step is to upload the original image and set the file name to 123.jpg.
Step 2: Use the uploaded image 123.jpg to generate a picture 23_t.jpg
Step 3: Add a watermark on the watermark 23_t.jpg

The server with 123.jpg 123_t.jpg at the end

I want to know if I can directly use abc.jpg to generate a thumbnail before uploading abc.jpg in the first step? (The reason is that you do not want to upload the source image or delete the file after uploading it)
Step 3 and Step 2 cannot be fully merged. Why do I need to scale down and add a watermark at the same time with 123.jpg?

Yes. However, this is not recommended.

The first method is to use the Image processing function provided by CI to process images in the memory as needed.

Second, modify the system function. (I have not tested it. You can test it by yourself and then reply to me)

Open/system/libraries/Image_lib.phpFile, which contains approximately 39th rows

var $thumb_marker = '_thumb';

To:

var $thumb_marker = '';

After the test, don't forget to reply to me.

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.