In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use geimagesize in php, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
php geimagesize measures the size of any image file and returns the image's size along with the file type and a height/width text string that can be used in IMG tags in plain HTML files using syntax such as "geimagesize ('xxx.jpg ')."
Operating environment: Windows 7 system, PHP7.1 version, DELL G3 computer
The getimagesize() function measures the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and returns the image's size along with the file type and a height/width text string that can be used in IMG tags in normal HTML files.
php geimagesize method detailed explanation
The geimagesize method allows you to view the details of an image, as follows:
> print_r(getimagesize('mnjpg.jpg'));Array( [0] => 2250 //width [1] => 1500 //High [2] => 3 //Type [3] => width="2250" height="1500" [bits] => 8 [mime] => image/png)
Image Type Description
$imageTypeArray = array( 0 => 'UNKNOWN', 1 => 'GIF', 2 => 'JPEG', 3 => 'PNG', 4 => 'SWF', 5 => 'PSD', 6 => 'BMP', 7 => 'TIFF_II', 8 => 'TIFF_MM', 9 => 'JPC', 10 => 'JP2', 11 => 'JPX', 12 => 'JB2', 13 => 'SWC', 14 => 'IFF', 15 => 'WBMP', 16 => 'XBM', 17 => 'ICO', 18 => 'COUNT' );
Image upload, take jpeg type as an example
$old_image = imagecreatefromjpeg ($image_url);$new_image = imagecreatetruecolor ($width, $height);imagecopy ($new_image, $old_image, 0, 0, $x1, $y1, $width, $height);ob_start();imagejpeg ($new_image);$contents = ob_get_contents();ob_end_clean();imagedestroy ($old_image);imagedestroy ($new_image);//upload new image to image server $url = 'xxx/upload';$client = Apf_Http_CurlClient::getInstance();$ret = $client->doPost ($url, array('file' => base64_encode($contents)), array(), array(), 1000);$ret = json_decode ($ret, true); Thank you for reading this article carefully, I hope Xiaobian shared "how to use geimagesize in php" This article is helpful to everyone, but also hope that everyone will support, pay attention to the industry information channel, more relevant knowledge waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.