update : 2015.11.03
php.shukuma.com

검색:
 
 
파일이나 URL에서 새 이미지를 생성

imagecreatefromwebp

(PHP 5 >= 5.5.0, PHP 7)

imagecreatefromwebp파일이나 URL에서 새 이미지를 생성

설명

resource imagecreatefromwebp ( string $filename )

imagecreatefromwebp() returns an image identifier representing the image obtained from the given filename.

Tip

fopen 래퍼를 활성화하면, 파일명으로 URL을 사용할 수 있습니다. 파일 이름을 지정하는 방법은 fopen()을 참고하십시오. 다양한 래퍼의 기능, 사용법, 제공하는 예약 정의 변수들에 대해서는 Supported Protocols and Wrappers를 참고하십시오.

인수

filename

Path to the WebP image.

반환값

성공 시에 이미지 자원 지시자를, 오류 시에 FALSE를 반환합니다.

예제

Example #1 Convert an WebP image to a jpeg image using imagecreatefromwebp()

<?php
// Load the WebP file
$im imagecreatefromwebp('./example.webp');

// Convert it to a jpeg file with 100% quality
imagejpeg($im'./example.jpeg'100);
imagedestroy($im);
?>