mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Merge pull request #671 from vichan-devel/webpsupport
add webp support to vichan exact changes are on soyjak.party and work
This commit is contained in:
commit
421e7ff283
@ -818,6 +818,7 @@
|
||||
$config['allowed_ext'][] = 'bmp';
|
||||
$config['allowed_ext'][] = 'gif';
|
||||
$config['allowed_ext'][] = 'png';
|
||||
$config['allowed_ext'][] = 'webp';
|
||||
// $config['allowed_ext'][] = 'svg';
|
||||
|
||||
// Allowed extensions for OP. Inherits from the above setting if set to false. Otherwise, it overrides both allowed_ext and
|
||||
|
@ -496,3 +496,12 @@ class ImageBMP extends ImageBase {
|
||||
imagebmp($this->image, $src);
|
||||
}
|
||||
}
|
||||
|
||||
class ImageWEBP extends ImageBase {
|
||||
public function from() {
|
||||
$this->image = @imagecreatefromwebp($this->src);
|
||||
}
|
||||
public function to($src) {
|
||||
imagewebp($this->image, $src);
|
||||
}
|
||||
}
|
||||
|
2
post.php
2
post.php
@ -983,7 +983,7 @@ if (isset($_POST['delete'])) {
|
||||
if (!$size = @getimagesize($file['tmp_name'])) {
|
||||
error($config['error']['invalidimg']);
|
||||
}
|
||||
if (!in_array($size[2], array(IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_BMP))) {
|
||||
if (!in_array($size[2], array(IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_BMP, IMAGETYPE_WEBP))) {
|
||||
error($config['error']['invalidimg']);
|
||||
}
|
||||
if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) {
|
||||
|
Loading…
Reference in New Issue
Block a user