Recently, the idea was to extract images on the webpage through regular expressions and then splice the extracted images together. However, we encountered several problems and did not know how to solve them to generate spliced images more effectively. Because it is a PHP cainiao, I have just read some beginner knowledge, so the following practices are only available to myself... recently, the idea was to extract images on the webpage through regular expressions and then splice the extracted images together. However, we encountered several problems and did not know how to solve them to generate spliced images more effectively.
Because it is a PHP cainiao, I have just read some introductory knowledge, so the following practices are only applicable to my own capabilities.
My fundamental needs are:
1. Based on the URL address, obtain the content area image (about 10 images), splice multiple images into one image, and set the width of the spliced Image Based on my requirements, the height of the spliced image is the height of all the images that match the regular expression. The height is automatically added and spliced according to the width I have defined. Ensure that the image of each part is displayed properly after splicing.
Current practice:
1. Regular Expressions capture image URLs from a Web page --- download images ----- batch thumbnails of images (equal proportion to generate thumbnails) ---- and splice images with the GD library.
When the idea reaches implementation, I feel that the performance is very poor. There are multiple steps. Each step requires a long time to process the image, which can easily lead to timeout.
If you want to implement this process, you don't know how it is implemented. The method is the same as mine?
Reply content:
Recently, the idea was to extract images on the webpage through regular expressions and then splice the extracted images together. However, we encountered several problems and did not know how to solve them to generate spliced images more effectively.
Because it is a PHP cainiao, I have just read some introductory knowledge, so the following practices are only applicable to my own capabilities.
My fundamental needs are:
1. Based on the URL address, obtain the content area image (about 10 images), splice multiple images into one image, and set the width of the spliced Image Based on my requirements, the height of the spliced image is the height of all the images that match the regular expression. The height is automatically added and spliced according to the width I have defined. Ensure that the image of each part is displayed properly after splicing.
Current practice:
1. Regular Expressions capture image URLs from a Web page --- download images ----- batch thumbnails of images (equal proportion to generate thumbnails) ---- and splice images with the GD library.
When the idea reaches implementation, I feel that the performance is very poor. There are multiple steps. Each step requires a long time to process the image, which can easily lead to timeout.
If you want to implement this process, you don't know how it is implemented. The method is the same as mine?
Use imagemagick