In drupal, use the image_style_url function to convert an address public://… into an externally accessible URL, this
The first parameter required by the function is the image style, which is used to specify the size of the thumbnail, in the background admin/config/media/image-styles
Configuration-media-image style is configured.
Thumbnails may not be generated before the user visits, and the ungenerated images will be generated through the rewrite rules of servers such as apache and nginx when accessing. Under the Apache server, the rewrite rules are straightforward, but under nginx, you need to modify the rewrite rules and add a few sentences, as follows:
|
location ~* files/styles { |
That is to say, the picture will only be generated when the address is accessed, so that the picture will only be generated when needed, and can be reused after generation. If the picture is updated, you only need to delete the old one.