• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Consider adding WEBP as an allowed extension for files uploading

Joined
Apr 18, 2013
Messages
598 (0.23/day)
  • All major web browsers support it natively (except Internet Explorer 11 which was released ages ago and Safari).
  • It allows to make lossless screenshots which on average weigh at 50% of the corresponding PNG.
See the attachment as a proof. The resulting BMPs are 100% bit identical. You can use the free IrfanView image viewer/editor to convert to WEBP.

If you're OK with that, then it makes sense to tell the forum software that webp is an image type.
 

Attachments

  • 155.5 KB Views: 19

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
20,224 (3.48/day)
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
Global: 78.64%

webp only works well at this time if you auto-convert server-side, detect the browser support and auto-send webp instead of png/jpg
 
Joined
Apr 18, 2013
Messages
598 (0.23/day)
Global: 78.64%

webp only works well at this time if you auto-convert server-side, detect the browser support and auto-send webp instead of png/jpg
I wasn't talking about converting website assets to WebP. I just wanted it to be enabled in your forums, so that people could upload webp pictures (right not you can upload WebP's only as part of ZIP files). And the figure is far above 78.64% for one simple reason that absolute most users on TPU are from Windows. :) But suit yourself anyways.
 
Joined
Aug 20, 2007
Messages
12,714 (2.75/day)
System Name Pioneer
Processor Intel i9 9900k
Motherboard ASRock Z390 Taichi
Cooling Noctua NH-D15 + A whole lotta Sunon and Corsair Maglev blower fans...
Memory G.SKILL TridentZ Series 32GB (4 x 8GB) DDR4-3200 @ 14-14-14-34-2T
Video Card(s) AMD RX 5700 XT (XFX THICC Ultra III)
Storage Mushkin Pilot-E 2TB NVMe SSD w/ EKWB M.2 Heatsink
Display(s) 32" 1440p LG 32GK850F Freesync 2 Monitor based on an AU Optronics true 8-bit AMVA Panel
Case Thermaltake Core X31
Audio Device(s) VGA HDMI->Panasonic SC-HTB20/Schiit Modi MB/Asgard 2 DAC/Amp to AKG Pro K7712 Headphones
Power Supply SeaSonic Prime 750W 80Plus Titanium
Mouse ROCCAT Kone EMP
Keyboard WASD CODE 104-Key w/ Cherry MX Green Keyswitches, Doubleshot Vortex PBT White Transluscent Keycaps
Software Windows 10 Enterprise (yes, it's legit.)
I would not mind, I alreeady try to use lossless pngs where possible anyhow to save bandwidth (gui screenshots, etc are usually smaller than jpg).

But no biggie either way.
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
20,224 (3.48/day)
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
so that people could upload webp pictures
This has been enabled. I'm still undecided, because some people won't be able to view your images. Let's see what happens
 
Joined
Apr 18, 2013
Messages
598 (0.23/day)
Test - passed.

@W1zzard how difficult will it be to make XenForo treat such files as pictures as opposed to binary attachments?

So, now your forums return:
Code:
Content-Disposition: attachment; filename="1.webp"
and instead it must be:
Code:
Content-Type: image/webp
 

Attachments

Last edited:
Joined
Aug 20, 2007
Messages
12,714 (2.75/day)
System Name Pioneer
Processor Intel i9 9900k
Motherboard ASRock Z390 Taichi
Cooling Noctua NH-D15 + A whole lotta Sunon and Corsair Maglev blower fans...
Memory G.SKILL TridentZ Series 32GB (4 x 8GB) DDR4-3200 @ 14-14-14-34-2T
Video Card(s) AMD RX 5700 XT (XFX THICC Ultra III)
Storage Mushkin Pilot-E 2TB NVMe SSD w/ EKWB M.2 Heatsink
Display(s) 32" 1440p LG 32GK850F Freesync 2 Monitor based on an AU Optronics true 8-bit AMVA Panel
Case Thermaltake Core X31
Audio Device(s) VGA HDMI->Panasonic SC-HTB20/Schiit Modi MB/Asgard 2 DAC/Amp to AKG Pro K7712 Headphones
Power Supply SeaSonic Prime 750W 80Plus Titanium
Mouse ROCCAT Kone EMP
Keyboard WASD CODE 104-Key w/ Cherry MX Green Keyswitches, Doubleshot Vortex PBT White Transluscent Keycaps
Software Windows 10 Enterprise (yes, it's legit.)
Test - passed.

@W1zzard how difficult will it be to make XenForo treat such files as pictures as opposed to a binary attachment?

So, now your forums return:

Code:
Content-Disposition: attachment; filename="1.webp"
and instead it must be:

Code:
Content-Type: image/webp
Yeah, without that the utility is like zero.
 
Joined
May 13, 2010
Messages
5,068 (1.40/day)
System Name RemixedBeast-NX
Processor Intel Xeon E5-2650 @ 2.2Ghz (8C/16T)
Motherboard Dell Inc. 08HPGT (CPU 1)
Cooling Dell Standard
Memory 32GB ECC
Video Card(s) EVGA Nvidia GTX 650 Ti SSC 1GB
Storage 500GB Samsung 850//2TB WD Black
Display(s) Samsung SyncMaster P2350 23in @ 1920x1080 + Dell E2013H 20 in @1600x900
Case Dell Precision T3600 Chassis
Audio Device(s) Beyerdynamic DT770 Pro 80 // Fiio E7 Amp/DAC
Power Supply 630w Dell T3600 PSU
Mouse Logitech G700s/G502
Keyboard Logitech K740
Software Windows Server 2012 x64 Standard
Benchmark Scores Network: APs: Cisco Meraki MR32, Ubiquiti Unifi AP-AC-LR and Lite Router/Sw:Meraki MX64 MS220-8P
I tried to upload a webp and the forum didn't let me. Had to ss with my phone using the edge menu and then upload the png it made..

I use slimjet browser (chrome variant) on desktop and Samsung browser on mobile
 
Joined
Apr 18, 2013
Messages
598 (0.23/day)
@W1zzard

If XenForo doesn't allow that, it could be trivially changed in nginx/apache either by replacing attachment with inline or removing Content-Disposition altogether.
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
20,224 (3.48/day)
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
The underlying technical reason why webp isn't displayed inline is because the current php software stack doesnt support validating them.
if you just display anything ".webp", it can leads to xss
 
Joined
Apr 18, 2013
Messages
598 (0.23/day)
So they need to formally verify that the particular file is indeed a WebP image otherwise it could lead to an XSS. OK. I wonder why it's taking them so long to write a verifier for this format. It is well described and the feature could be implemented in under an hour: https://developers.google.com/speed/webp/docs/riff_container

Again, it's not for you, it's for XenForo developers but it just sucks that they don't want to support this standard.

There's a bog-standard function to parse binary files in PHP: https://www.php.net/manual/en/function.unpack.php

I can probably write a verifier in my spare time. Nothing looks complicated.
 
Last edited:
Top