wordpress 媒体信息中用到的一些东西
在做自己的网站,里面的blog计划借鉴wordpress的数据结构。在上传图像文件中,需要保存一些信息,其中用到以下不常用的函数:
exif_read_data() 读取照片exif信息。 需要开启 mbstring 和 exif 这两个php扩展。
https://blog.csdn.net/wojiaoliujiawei/article/details/89173440 利用本函数获取图片的拍摄gps地点。
https://www.jb51.net/article/66493.htm 利用本函数获取图片的exif信息,exif_thumbnail() 这个函数直接获取 JPG 文件中 EXIF 里面保存的缩略图信息。
mp4 mp3之类的媒体信息,可以安装getid3这个php包来处理。
https://blog.51cto.com/u_15230485/2821195
1 2 3 4 5 6 7 8 |
* pathinfo(path,options) * Array ( [dirname] => /testweb [basename] => test.txt [extension] => txt [filename] => test ) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/* * @exif_read_data( $path ) * EXIF 信息只在 JPG 、 TIFF 等类型的图片格式中存在 * [ "FileName" => "07c6e4e05cc549c0349520dff67b8c6a.jpg" "FileDateTime" => 1630920484 "FileSize" => 371564 "FileType" => 2 "MimeType" => "image/jpeg" "SectionsFound" => "ANY_TAG, IFD0, EXIF" "COMPUTED" => array:5 [ "html" => "width="1600" height="2153"" "Height" => 2153 "Width" => 1600 "IsColor" => 1 "ByteOrderMotorola" => 1 ] "Orientation" => 1 "Exif_IFD_Pointer" => 38 "ColorSpace" => 1 "ExifImageWidth" => 1600 "ExifImageLength" => 2153 ] */ |
噢!评论已关闭。