成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導(dǎo)航首頁 ? 技術(shù)教程 ? PHP:iptcembed()的用法_GD庫圖像處理函數(shù)
全站頭部文字 我要出現(xiàn)在這里
PHP:iptcembed()的用法_GD庫圖像處理函數(shù) 717 2023-12-15   

iptcembed

(PHP 4, PHP 5)

iptcembed — 將二進制 IPTC 數(shù)據(jù)嵌入到一幅 JPEG 圖像中

說明

mixed iptcembed ( string $iptcdata , string $jpeg_file_name [, int $spool ] )

Embeds binary IPTC data into a JPEG image.

參數(shù)

iptcdata

The data to be written.

jpeg_file_name

Path to the JPEG image.

spool

Spool 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() function by Thies C. Arntzen
function iptc_make_tag($rec, $data, $value)
{
    $length = strlen($value);
    $retval = chr(0x1C) . chr($rec) . chr($data);

    if($length < 0x8000)
    {
        $retval .= chr($length >> 8) .  chr($length & 0xFF);
    }
    else
    {
        $retval .= chr(0x80) . 
                   chr(0x04) . 
                   chr(($length >> 24) & 0xFF) . 
                   chr(($length >> 16) & 0xFF) . 
                   chr(($length >> 8) & 0xFF) . 
                   chr($length & 0xFF);
    }

    return $retval . $value;
}

// Path to jpeg file
$path = './phplogo.jpg';

// We need to check if theres any IPTC data in the jpeg image. If there is then 
// bail out because we cannot embed any image that already has some IPTC data!
$image = getimagesize($path, $info);

if(isset($info['APP13']))
{
    die('Error: IPTC data found in source image, cannot continue');
}

// Set the IPTC tags
$iptc = array(
    '2#120' => 'Test image',
    '2#116' => 'Copyright 2008-2009, The PHP Group'
);

// Convert the IPTC tags into binary code
$data = '';

foreach($iptc as $tag => $string)
{
    $tag = substr($tag, 2);
    $data .= iptc_make_tag(2, $tag, $string);
}

// Embed the IPTC data
$content = iptcembed($data, $path);

// Write the new image data out to the file.
$fp = fopen($path, "wb");
fwrite($fp, $content);
fclose($fp);
?>

注釋

Note:

此函數(shù)不需要 GD 圖象庫。


主站蜘蛛池模板: 749局演员表| 电影名《走进房间》在线观看| 超英| cctv五+频道在线直播节目单| 情满四合院46集免费播放电视剧| 江南好简谱| 美女写真视频网站| 头像图| 哥哥太爱我怎么办| 松山爱| 抗日电影大突围完整版| 抗日电影完整版| 赖小子在线观看完整视频高清| 杨幂的视频| 低糖食物一览表| 推拿电影| 我会读心术免费观看完整版| 魔法少女加奈| 工字钢理论重量| 艳妇乳肉豪妇荡乳ⅹxxooav| 新版新白娘子传奇电视剧| 爱很简单简谱| 安德鲁·林肯| squirt cytherea video| 好男儿之情感护理| 朱茉颜| 芭蕉扇图片| 金雪贤| 美女mm| 白洁合集| 百家讲坛《两宋风云》| 一条路千山万水| 太太的情人电影| 林书宇| 黑暗女监日本电影完整版叫什么| 印度电影《希努》| 书柜效果图大全2023款| 天才不能承受之重| 违规吃喝问题研讨发言材料| 程门立雪文言文| cctv1回放|

!!!站長長期在線接!!!

網(wǎng)站、小程序:定制開發(fā)/二次開發(fā)/仿制開發(fā)等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103