- Generates and displays a thumbnail image of the size specified by the URL parameter.
-
The
Originheader is checked in the program. This prevents the image generation process from running if the URL is entered directly or embedded from another site without permission. - If a thumbnail image has already been generated (in the case of the second or later requests), the generated image will be displayed instead of processing the generation.
- If the original image has been updated (the file's modified date is newer than the thumbnail image), the generation process will be repeated.
URL Parameters
e.g.
/thumbimage/path/to/sample.jpg?type=webp;w=360;h=240;quality=30
-
The type, width, height, and quality can be specified in the URL parameters.
Image Type URL parameters type(Required)whqualityAVIF avif1-99991-99991-100(default: 80)WebP webpJPEG jpegPNG png✘ (ignore) -
The
typeparameter can be singular or multiple. If multiple values are specified, the image will be displayed based on theAcceptrequest header.Acceptrequest headertypeparametersResponse image type image/webp,*/* type=avifAVIF (Cannot be displayed) type[]=avif;type[]=webp;type[]=jpegWebP type[]=jpeg;type[]=webp;type[]=avifWebP image/avif,image/webp,*/* type=avifAVIF type[]=avif;type[]=webp;type[]=jpegAVIF type[]=jpeg;type[]=webp;type[]=avifAVIF -
If the parameter
worhis larger than the size of the original image, thumbnails will be generated at the size of the original image.Original image size URL parameters Generated image size 1920×1280 w=9999;h=99991920×1280 w=9999;h=640960×640 w=360;h=640360×240 w=99991920×1280 h=640960×640 (not specified) 1920×1280 - If the value of the parameter is invalid, return
403 Forbidden. (e.g.?type=xxx;w=10000;h=10000;quality=0)
Sample
Original file
- Path
- /image/sample.jpg
- Type
- JPEG
- Width
- 1920px
- Height
- 1280px
- Quality
- 80
Generated thumbnail image
<picture>
<source type="image/avif" srcset="/thumbimage/sample.jpg?type=avif;w=360;quality=30" />
<source type="image/webp" srcset="/thumbimage/sample.jpg?type=webp;w=360;quality=30" />
<img src="/thumbimage/sample.jpg?type=jpeg;w=360;quality=30" alt="Sample Image" crossorigin="" />
</picture>