Thumbnail
The word thumbnail describes in the IT area a kind of preview image, image preview or also thumbnail image.
Use of Thumbnails
A thumbnail offers the possibility to display many small images on a single web page. For the visitor of the web page this results in a better overview. Furthermore, he has the possibility to click on a specific image. By clicking on the thumbnail, it may appear in a larger format or a new program may be started.
Thumbnail creation with PHP
Thumbnail creation is possible, for example, with the PHP scripting language using the GD library. In this library images can be created, edited and saved. Before the thumbnail is created, information about the name of the original image or image file is entered. Afterwards height and width of the thumbnail are specified. In addition, it must be determined whether it is a GIF, JPG or PNG graphic file. The original image is then read in with the function “ImageCreateFormGIF/JPG/PNG(…)”. With the function “ImageCopyResized()” the new image is created. The function does not need the filename of the original image or the destination file, but only the identifier of this file. The identifiers are created by the functions “ImageCreateForm…(…)” for the original and “ImageCreate()” for the destination file. The identifier, the start position (0,0) and the formats of the image are passed to “ImageCopyResized(…)”. From this follows the result, which is entered into the file with “Image…(…)”. It is recommended to mark the reduced file with TN (for thumbnail) to avoid overwriting the original file.
Optimizing the website with thumbnails
A thumbnail image can be especially important for online stores, as thumbnails allow for a better overview of the entire product range. Moreover, these thumbnails can also give information about the actual website and influence users in product search and purchase decisions. Thumbnails also reduce loading time and prevent users from losing interest and leaving the online store again.