Skip to content

Commit 9613532

Browse files
committed
WebP mime type and Image_lib support
1 parent ccd42e6 commit 9613532

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

application/config/mimes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
8787
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
8888
'png' => array('image/png', 'image/x-png'),
89+
'webp' => 'image/webp',
8990
'tiff' => 'image/tiff',
9091
'tif' => 'image/tiff',
9192
'heic' => 'image/heic',

system/libraries/Image_lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ public function initialize($props = array())
573573
else
574574
{
575575
// Is there a file name?
576-
if ( ! preg_match('#\.(jpg|jpeg|gif|png)$#i', $this->new_image))
576+
if ( ! preg_match('#\.(jpg|jpeg|gif|png|webp)$#i', $this->new_image))
577577
{
578578
$this->dest_image = $this->source_image;
579579
$this->dest_folder = $this->new_image;

0 commit comments

Comments
 (0)