Created
January 28, 2020 02:52
-
-
Save hainuo/d9688057d7fb0e425295f620e99b436f to your computer and use it in GitHub Desktop.
将webp转换为png格式
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//include 'vendor/autoload.php'; | |
$list = glob('/Users/hainuo/Downloads/语文/*.webp'); | |
foreach ( $list as $filename){ | |
$dirname = dirname($filename); | |
$pngPath = $filename.'.png'; | |
$img = imagecreatefromwebp($filename); | |
imagepng($img,$pngPath); | |
imagedestroy($img); | |
// dump('处理完成'.basename($filename)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment