If you use the imageJPEG() function to generate a JPEG format image, you can also specify the quality of the JPEG format image through the third optional parameter $quality. This will not only not output the image directly to the browser, but also do not need to use the header() function to send header information. If you want to save the image dynamically drawn by PHP on the local server, you must specify a file name string in the second optional parameter. Php resize image imagejpeg imagepng imagegif portable#The following code snippet writes a more portable PHP program by automatically detecting the image types supported by the GD library. But be sure to use the header() function to send the header information before outputting to inform the browser to use the correct MIME type to parse the received content and let it know that we are sending pictures instead of text-like HTML. If these functions provide other parameters, the original image will be streamed directly when accessed, and the dynamically output image will be displayed in the browser. The first parameter $image is a required option and is the image refnum introduced earlier. The use of the above four functions is similar, and the use of the first two parameters is the same. Bool imagegif(resource $image)//Output image in GIF formatīool imagejpeg(resource $image])//Output image in JPEG formatīool imagepng (resource $image)//Output the image in PNG formatīool imagewbmp(resource $image])//Output the image in WBMP format
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |