This code will create a thumbnail of an image on-the-fly using its URL. The imagecreatefromjpeg() function creates a resource handle for the JPEG image file. The imagecreatetruecolor() function creates an empty true color image with the specified width and height. The imagecopyresized() function resizes and copies a portion of the source image into the thumbnail. Finally, the header() function sets the content type to "image/jpeg" and the imagejpeg() function sends the thumbnail as a JPEG image to the browser. Package library: GD library is required for this example.