位置: 编程技术 - 正文
推荐整理分享PHP:iptcembed()的用法_GD库图像处理函数(phpipam使用),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:php-cp,php ioncube,php ioncube,php ioc,phpipam使用,php ipam,php ip,php ioncube,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4, PHP 5)
iptcembed — 将二进制 IPTC 数据嵌入到一幅 JPEG 图像中
说明 mixed iptcembed ( string $iptcdata , string $jpeg_file_name [, int $spool ] )Embeds binary IPTC data into a JPEG image.
参数iptcdata
The data to be written.
jpeg_file_namePath to the JPEG image.
spoolSpool flag. If the spool flag is over 2 then the JPEG will be returned as a string.
返回值If success and spool flag is lower than 2 then the JPEG will not be returned as a string, FALSE on errors.
范例Example #1 Embedding IPTC data into a JPEG
<?php//iptc_make_tag()functionbyThiesC.Arntzenfunctioniptc_make_tag($rec,$data,$value){$length=strlen($value);$retval=chr(0x1C).chr($rec).chr($data);if($length<0x){$retval.=chr($length>>8).chr($length&0xFF);}else{$retval.=chr(0x).chr(0x).chr(($length>>)&0xFF).chr(($length>>)&0xFF).chr(($length>>8)&0xFF).chr($length&0xFF);}return$retval.$value;}//Pathtojpegfile$path='./phplogo.jpg';//WeneedtocheckiftheresanyIPTCdatainthejpegimage.Ifthereisthen//bailoutbecausewecannotembedanyimagethatalreadyhassomeIPTCdata!$image=getimagesize($path,$info);if(isset($info['APP'])){die('Error:IPTCdatafoundinsourceimage,cannotcontinue');}//SettheIPTCtags$iptc=array('2#'=>'Testimage','2#'=>'Copyright-,ThePHPGroup');//ConverttheIPTCtagsintobinarycode$data='';foreach($iptcas$tag=>$string){$tag=substr($tag,2);$data.=iptc_make_tag(2,$tag,$string);}//EmbedtheIPTCdata$content=iptcembed($data,$path);//Writethenewimagedataouttothefile.$fp=fopen($path,"wb");fwrite($fp,$content);fclose($fp);?> 注释Note:
此函数不需要 GD 图象库。
PHP:png2wbmp()的用法_GD库图像处理函数 png2wbmp(PHP4=4.0.5,PHP5)png2wbmp将PNG图像文件转换为WBMP图像文件说明boolpng2wbmp(string$pngname,string$wbmpname,int$dest_height,int$dest_width,int$threshold)将名为pngname的PNG文件
PHP:jpeg2wbmp()的用法_GD库图像处理函数 jpeg2wbmp(PHP4=4.0.5,PHP5)jpeg2wbmp将JPEG图像文件转换为WBMP图像文件说明booljpeg2wbmp(string$jpegname,string$wbmpname,int$dest_height,int$dest_width,int$threshold)将JPEG图像文件转
PHP:iptcparse()的用法_GD库图像处理函数 iptcparse(PHP4,PHP5)iptcparse将二进制IPTC块解析为单个标记说明arrayiptcparse(string$iptcblock)本函数将一个二进制的IPTC块解析为单个的标记。参数iptcblock二进制的IP
标签: phpipam使用
本文链接地址:https://www.jiuchutong.com/biancheng/284734.html 转载请保留说明!友情链接: 武汉网站建设