当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。