const VP8X_XMP = 4;
const VP8X_ANIM = 2;
- function getMetadata( $image, $filename ) {
+ public function getMetadata( $image, $filename ) {
$parsedWebPData = self::extractMetadata( $filename );
if ( !$parsedWebPData ) {
return self::BROKEN_FILE;
return serialize( $parsedWebPData );
}
- function getMetadataType( $image ) {
+ public function getMetadataType( $image ) {
return 'parsed-webp';
}
- function isMetadataValid( $image, $metadata ) {
+ public function isMetadataValid( $image, $metadata ) {
if ( $metadata === self::BROKEN_FILE ) {
// Do not repetitivly regenerate metadata on broken file.
return self::METADATA_GOOD;
);
}
- function getImageSize( $file, $path, $metadata = false ) {
+ public function getImageSize( $file, $path, $metadata = false ) {
if ( $file === null ) {
$metadata = self::getMetadata( $file, $path );
}
* @param $file
* @return bool True, not all browsers support WebP
*/
- function mustRender( $file ) {
+ public function mustRender( $file ) {
return true;
}
* @param $file
* @return bool False if we are unable to render this image
*/
- function canRender( $file ) {
+ public function canRender( $file ) {
if ( self::isAnimatedImage( $file ) ) {
return false;
}
* @param File $image
* @return bool
*/
- function isAnimatedImage( $image ) {
+ public function isAnimatedImage( $image ) {
$ser = $image->getMetadata();
if ( $ser ) {
$metadata = unserialize( $ser );
return false;
}
- function canAnimateThumbnail( $file ) {
+ public function canAnimateThumbnail( $file ) {
return false;
}
* @param $params
* @return array
*/
- function getThumbType( $ext, $mime, $params = null ) {
+ public function getThumbType( $ext, $mime, $params = null ) {
return array( 'png', 'image/png' );
}