jpg
jpeg
png
+webp
bmp
zip
txt
jpg
jpeg
png
+webp
bmp
zip
txt
jpg
jpeg
png
+webp
bmp</defaultvalue>
<wildcard>*</wildcard>
<options>module_user_signature</options>
<defaultvalue>gif
jpg
jpeg
-png</defaultvalue>
+png
+webp</defaultvalue>
<usersonly>1</usersonly>
</option>
<option name="user.profile.coverPhoto.canSeeCoverPhotos">
{if !$results[php][gd][png]}
<li>{@$statusInsufficient} <kbd>png</kbd></li>
{/if}
+ {if !$results[php][gd][webp]}
+ <li>{@$statusInsufficient} <kbd>webp</kbd></li>
+ {/if}
</ul>
{/if}
<small>{lang}wcf.acp.systemCheck.php.gd.description{/lang}</small>
emptyHtml: '<p>​</p>',
invisibleSpace: '​',
emptyHtmlRendered: $('').html('').html(),
- imageTypes: ['image/png', 'image/jpeg', 'image/gif'],
+ imageTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp'],
userAgent: navigator.userAgent.toLowerCase(),
observe: {
dropdowns: []
// As our resizer is based on Pica it will use multiple workers per image if possible.
promise = Array.prototype.reduce.call(files, (function (acc, file) {
return acc.then((function (arr) {
- // Ignore anything that is not one of the 3 basic image types.
- if (['image/png', 'image/gif', 'image/jpeg'].indexOf(file.type) === -1) {
+ // Ignore anything that is not one of the 4 basic image types.
+ if (['image/png', 'image/gif', 'image/jpeg', 'image/webp'].indexOf(file.type) === -1) {
arr.push(file);
return arr;
}
case 'image/gif':
$ext = '.gif';
break;
+
+ case 'image/webp':
+ $ext = '.webp';
+ break;
}
$files.push({
case "image/png":
fileExtension = "png";
break;
+ case "image/webp":
+ fileExtension = "webp";
+ break;
}
files.push({
name: `pasted-from-clipboard.${fileExtension}`,
'gd' => [
'jpeg' => false,
'png' => false,
+ 'webp' => false,
'result' => false,
],
'extension' => [],
$gdInfo = \gd_info();
$this->results['php']['gd']['jpeg'] = !empty($gdInfo['JPEG Support']);
$this->results['php']['gd']['png'] = !empty($gdInfo['PNG Support']);
+ $this->results['php']['gd']['webp'] = !empty($gdInfo['WebP Support']);
- $this->results['php']['gd']['result'] = $this->results['php']['gd']['jpeg'] && $this->results['php']['gd']['png'];
+ $this->results['php']['gd']['result'] = $this->results['php']['gd']['jpeg']
+ && $this->results['php']['gd']['png']
+ && $this->results['php']['gd']['webp'];
$this->results['status']['php'] = $this->results['status']['php'] && $this->results['php']['gd']['result'];
}
class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject {
const EXCLUDE_WCF_VERSION = '6.0.0 Alpha 1';
const INFO_FILE = 'style.xml';
- const VALID_IMAGE_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', 'svg', 'xml', 'json'];
+ const VALID_IMAGE_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', 'svg', 'xml', 'json', 'webp'];
/**
* list of compatible API versions
$imagesTar = new TarWriter($imagesTarName);
FileUtil::makeWritable($imagesTarName);
- $regEx = new Regex('\.(jpg|jpeg|gif|png|svg|ico|json|xml|txt)$', Regex::CASE_INSENSITIVE);
+ $regEx = new Regex('\.(jpg|jpeg|gif|png|svg|ico|json|xml|txt|webp)$', Regex::CASE_INSENSITIVE);
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(
$this->getAssetPath(),
if ($imageData !== false) {
$tmp['extension'] = ImageUtil::getExtensionByMimeType($imageData['mime']);
- if (!in_array($tmp['extension'], ['jpeg', 'jpg', 'png', 'gif'])) {
+ if (!in_array($tmp['extension'], ['jpeg', 'jpg', 'png', 'gif', 'webp'])) {
@unlink($filename);
return;
}
* list of mime types which belong to files that are displayed inline
* @var string[]
*/
- public static $inlineMimeTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/x-png', 'application/pdf', 'image/pjpeg'];
+ public static $inlineMimeTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/x-png', 'application/pdf', 'image/pjpeg', 'image/webp'];
/**
* etag for this attachment
'image/png',
'image/x-png',
'application/pdf',
- 'image/pjpeg'
+ 'image/pjpeg',
+ 'image/webp',
];
/**
* @var string
* @deprecated 5.3 Use \wcf\util\ImageUtil::$imageExtensions instead (direct replacement).
*/
- const VALID_IMAGE_EXTENSIONS = ['jpeg', 'jpg', 'png', 'gif'];
+ const VALID_IMAGE_EXTENSIONS = ['jpeg', 'jpg', 'png', 'gif', 'webp'];
/**
* Contains the registered upload fields.
}
break;
+ case IMAGETYPE_WEBP:
+ // suppress warnings and properly handle errors
+ $this->image = @imagecreatefromwebp($file);
+ if ($this->image === false) {
+ throw new SystemException("Could not read webp image '".$file."'.");
+ }
+ break;
+
default:
throw new SystemException("Could not read image '".$file."', format is not recognized.");
- break;
}
}
else if ($this->type == IMAGETYPE_PNG) {
imagepng($image);
}
+ else if ($this->type == IMAGETYPE_WEBP) {
+ imagewebp($image);
+ }
else if (function_exists('imageJPEG')) {
imagejpeg($image, null, 90);
}
* list of allowed file extensions
* @var string[]
*/
- public static $allowedExtensions = ['gif', 'jpg', 'jpeg', 'png'];
+ public static $allowedExtensions = ['gif', 'jpg', 'jpeg', 'png', 'webp'];
/**
* @inheritDoc
// excel
'xls' => 'excel', 'ods' => 'excel', 'xlsx' => 'excel',
// image
- 'gif' => 'image', 'jpg' => 'image', 'jpeg' => 'image', 'png' => 'image', 'bmp' => 'image',
+ 'gif' => 'image', 'jpg' => 'image', 'jpeg' => 'image', 'png' => 'image', 'bmp' => 'image', 'webp' => 'image',
// video
'avi' => 'video', 'wmv' => 'video', 'mov' => 'video', 'mp4' => 'video', 'mpg' => 'video', 'mpeg' => 'video', 'flv' => 'video',
// pdf
* image extensions
* @var array
*/
- protected static $imageExtensions = ['jpeg', 'jpg', 'png', 'gif'];
+ protected static $imageExtensions = ['jpeg', 'jpg', 'png', 'gif', "webp"];
/**
* Checks the content of an image for bad sections, e.g. the use of javascript
return 'bmp';
case 'image/tiff':
return 'tiff';
+ case 'image/webp':
+ return 'webp';
default:
return '';
}
case "image/png":
fileExtension = "png";
break;
+ case "image/webp":
+ fileExtension = "webp";
+ break;
}
files.push({
name: `pasted-from-clipboard.${fileExtension}`,
<item name="wcf.acp.systemCheck.directories.writable"><![CDATA[Beschreibbare Verzeichnisse]]></item>
<item name="wcf.acp.systemCheck.directories.writable.description"><![CDATA[Einige Verzeichnisse werden zur Laufzeit durch die Software beschrieben, der PHP-Benutzer muss Schreibrechte haben.]]></item>
<item name="wcf.acp.systemCheck.php.gd"><![CDATA[Unterstützte Formate der GD-Bibliothek]]></item>
- <item name="wcf.acp.systemCheck.php.gd.description"><![CDATA[Die GD-Bibliothek muss inklusive der Unterstützung der Formate „jpeg“ und „png“ installiert sein.]]></item>
+ <item name="wcf.acp.systemCheck.php.gd.description"><![CDATA[Die GD-Bibliothek muss inklusive der Unterstützung der Formate „jpeg“, „png“ und „webp“ installiert sein.]]></item>
</category>
<category name="wcf.acp.updateServer">
<item name="wcf.acp.updateServer.add"><![CDATA[Server hinzufügen]]></item>
<item name="wcf.image.coverPhoto.upload.error.minWidth"><![CDATA[Das Bild ist zu schmal.]]></item>
<item name="wcf.image.coverPhoto.upload.error.uploadFailed"><![CDATA[Beim Hochladen der Datei ist ein unbekannter Fehler aufgetreten.]]></item>
<item name="wcf.image.coverPhoto.upload.error.invalidExtension"><![CDATA[Die Datei hat eine ungültige Dateiendung.]]></item>
- <item name="wcf.image.coverPhoto.upload.limits"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png<br>Maximale Dateigröße: {$__wcf->session->getPermission($coverPhotoPermissionMaxSize)|filesize}]]></item>
+ <item name="wcf.image.coverPhoto.upload.limits"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png, webp<br>Maximale Dateigröße: {$__wcf->session->getPermission($coverPhotoPermissionMaxSize)|filesize}]]></item>
</category>
<category name="wcf.imageViewer">
<item name="wcf.imageViewer.button.enlarge"><![CDATA[Vollbild-Modus]]></item>
<item name="wcf.user.coverPhoto.error.disabled"><![CDATA[Der Administrator hat{if $__wcf->user->coverPhotoHash} {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} derzeitiges Titelbild gesperrt und{/if} {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} die weitere Nutzungsberechtigung der Titelbild-Funktion {if !$__wcf->user->disableCoverPhotoReason}entzogen.{else} aus folgenden Gründen entzogen: {$__wcf->user->disableCoverPhotoReason}{/if}]]></item>
<item name="wcf.user.coverPhoto.noImage"><![CDATA[Der Benutzer hat noch kein Titelbild hochgeladen.]]></item>
<item name="wcf.user.coverPhoto.upload"><![CDATA[Titelbild hochladen]]></item>
- <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png<br>Maximale Dateigröße: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
+ <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png, webp<br>Maximale Dateigröße: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
<item name="wcf.user.coverPhoto.upload.error.badImage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} kein gültiges Bild hochgeladen.]]></item>
<item name="wcf.user.coverPhoto.upload.error.fileExtension"><![CDATA[Die Datei hat eine ungültige Dateiendung.]]></item>
<item name="wcf.user.coverPhoto.upload.error.maxHeight"><![CDATA[Das Bild ist zu hoch.]]></item>
<item name="wcf.acp.systemCheck.directories.writable"><![CDATA[Writable Directories]]></item>
<item name="wcf.acp.systemCheck.directories.writable.description"><![CDATA[Some directories are being written to during the normal operation. The user that runs the PHP process must have write access.]]></item>
<item name="wcf.acp.systemCheck.php.gd"><![CDATA[Supported formats of the GD library]]></item>
- <item name="wcf.acp.systemCheck.php.gd.description"><![CDATA[The GD library must be installed with support for the formats “jpeg” and “png”.]]></item>
+ <item name="wcf.acp.systemCheck.php.gd.description"><![CDATA[The GD library must be installed with support for the formats “jpeg”, “png” and “webp”.]]></item>
</category>
<category name="wcf.acp.updateServer">
<item name="wcf.acp.updateServer.add"><![CDATA[Add Server]]></item>
<item name="wcf.image.coverPhoto.upload.error.minWidth"><![CDATA[The image is too small.]]></item>
<item name="wcf.image.coverPhoto.upload.error.uploadFailed"><![CDATA[An unknown error occurred during the upload.]]></item>
<item name="wcf.image.coverPhoto.upload.error.invalidExtension"><![CDATA[The file extension is invalid.]]></item>
- <item name="wcf.image.coverPhoto.upload.limits"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png<br>Maximum Filesize: {$__wcf->session->getPermission($coverPhotoPermissionMaxSize)|filesize}]]></item>
+ <item name="wcf.image.coverPhoto.upload.limits"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png, webp<br>Maximum Filesize: {$__wcf->session->getPermission($coverPhotoPermissionMaxSize)|filesize}]]></item>
</category>
<category name="wcf.imageViewer">
<item name="wcf.imageViewer.button.enlarge"><![CDATA[Full Screen Mode]]></item>
<item name="wcf.user.coverPhoto.error.disabled"><![CDATA[The administrators {if $__wcf->user->coverPhotoHash}have banned your cover photo and {/if}disallowed you from using a cover photo{if $__wcf->user->disableCoverPhotoReason}: {$__wcf->user->disableCoverPhotoReason}{/if}.]]></item>
<item name="wcf.user.coverPhoto.noImage"><![CDATA[The user has not yet uploaded a cover photo.]]></item>
<item name="wcf.user.coverPhoto.upload"><![CDATA[Upload Cover Photo]]></item>
- <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png<br>Maximum Filesize: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
+ <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width}×{$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width}×{$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png, webp<br>Maximum Filesize: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
<item name="wcf.user.coverPhoto.upload.error.badImage"><![CDATA[The uploaded file is not an image.]]></item>
<item name="wcf.user.coverPhoto.upload.error.fileExtension"><![CDATA[The file has an invalid extension.]]></item>
<item name="wcf.user.coverPhoto.upload.error.maxHeight"><![CDATA[The image is too tall.]]></item>