當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP Imagick decipherImage()用法及代碼示例

Imagick::decipherImage()函數是PHP中的內置函數,用於解密以前加密過的圖像。

用法:

bool Imagick::decipherImage( string $passphrase )

參數:該函數接受單個參數$passphrase,該參數保存密碼短語值或用於解密圖像的 key 。


返回值:成功時此函數返回TRUE。

以下示例程序旨在說明PHP中的Imagick::decipherImage()函數:

程序:

<?php 
  
/* Create a new Imagick object  
which is an enciphered image  
with passphrase 'GeeksforGeeks' */
$imagick = new Imagick( 
'https://media.geeksforgeeks.org/wp-content/uploads/20191020203919/g4genciphered.png'); 
  
// Applying the decipher() function 
$imagick->decipher('GeeksforGeeks');  
  
header("Content-Type: image/png");  
    
// Display the output image  
echo $imagick->getImageBlob(); 
?>

輸出:

參考: https://www.php.net/manual/en/imagick.decipherimage.php



相關用法


注:本文由純淨天空篩選整理自gurrrung大神的英文原創作品 PHP | Imagick decipherImage() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。