• 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
1,260 (0.31/day)
Location
Artem S. Tashkinov
  • 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

  • 1.zip
    155.5 KB · Views: 207

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,049 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
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
1,260 (0.31/day)
Location
Artem S. Tashkinov
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
20,787 (3.41/day)
System Name Pioneer
Processor Ryzen R9 7950X
Motherboard GIGABYTE Aorus Elite X670 AX
Cooling Noctua NH-D15 + A whole lotta Sunon and Corsair Maglev blower fans...
Memory 64GB (4x 16GB) G.Skill Flare X5 @ DDR5-6000 CL30
Video Card(s) XFX RX 7900 XTX Speedster Merc 310
Storage 2x Crucial P5 Plus 2TB PCIe 4.0 NVMe SSDs
Display(s) 55" LG 55" B9 OLED 4K Display
Case Thermaltake Core X31
Audio Device(s) TOSLINK->Schiit Modi MB->Asgard 2 DAC Amp->AKG Pro K712 Headphones or HDMI->B9 OLED
Power Supply FSP Hydro Ti Pro 850W
Mouse Logitech G305 Lightspeed Wireless
Keyboard WASD Code v3 with Cherry Green keyswitches + PBT DS keycaps
Software Gentoo Linux x64
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
27,049 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
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
1,260 (0.31/day)
Location
Artem S. Tashkinov
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

  • 1.webp
    47.7 KB · Views: 183
Last edited:
Joined
Aug 20, 2007
Messages
20,787 (3.41/day)
System Name Pioneer
Processor Ryzen R9 7950X
Motherboard GIGABYTE Aorus Elite X670 AX
Cooling Noctua NH-D15 + A whole lotta Sunon and Corsair Maglev blower fans...
Memory 64GB (4x 16GB) G.Skill Flare X5 @ DDR5-6000 CL30
Video Card(s) XFX RX 7900 XTX Speedster Merc 310
Storage 2x Crucial P5 Plus 2TB PCIe 4.0 NVMe SSDs
Display(s) 55" LG 55" B9 OLED 4K Display
Case Thermaltake Core X31
Audio Device(s) TOSLINK->Schiit Modi MB->Asgard 2 DAC Amp->AKG Pro K712 Headphones or HDMI->B9 OLED
Power Supply FSP Hydro Ti Pro 850W
Mouse Logitech G305 Lightspeed Wireless
Keyboard WASD Code v3 with Cherry Green keyswitches + PBT DS keycaps
Software Gentoo Linux x64
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,703 (1.12/day)
System Name RemixedBeast-NX
Processor Intel Xeon E5-2690 @ 2.9Ghz (8C/16T)
Motherboard Dell Inc. 08HPGT (CPU 1)
Cooling Dell Standard
Memory 24GB ECC
Video Card(s) Gigabyte Nvidia RTX2060 6GB
Storage 2TB Samsung 860 EVO SSD//2TB WD Black HDD
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 Linux Mint 20
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
1,260 (0.31/day)
Location
Artem S. Tashkinov
@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
27,049 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
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
1,260 (0.31/day)
Location
Artem S. Tashkinov
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