Helpful Information
 
 
Category: vBulletin 3.8 Modifications
Miscellaneous Hacks - Prevent APNG for users that are not allowed to have GIF images

This is a very small plugin.

We don't allow users to have GIF images. But users, clever as they are, started using APNG (http://en.wikipedia.org/wiki/APNG) images instead (Animated Portable Network Graphics) which vBulletin sees as regular PNG images. Even though it only works on a couple of browsers (unsupported browsers only see the first frame), we found it created allot of confusion (other users wondering why they couldn't upload animated avatars, while other had them).

This is a small plugin that will prevent users from uploading APNG images. It's so small it isn't even worth to be made into a product. It only rejects the image if the user is not allowed to upload animated images.

I only tested it on vBulletin 3.8, but I'm pretty sure this works on most versions.

Please note: this will only prevent new APNG avatars from being uploaded.

I got the detection part from: http://foone.org/apng/.

I hope a few of you can use this :).

Installation
Go to your Administration Panel then:

1. Go to the 'Plugins & Products' menu
2. 'Add New plugin'
3. Values:

Product: vBulletin
Hook location: upload_accept
Title: Prevent APNG for users that are not allowed to have GIF images
Execution Order: 5 (doesn't really matter)
Plugin PHP Code:

if(isset($this->allowanimation) AND $this->allowanimation === false)
{
$img_bytes = @file_get_contents($this->upload['location']);

if($img_bytes)
{
if(strpos(substr($img_bytes, 0, strpos($img_bytes, 'IDAT')), 'acTL') !== false)
{
$this->set_error('upload_invalid_animatedgif');
eval(standard_error($this->fetch_error()));
}
}
}

Plugin is Active: yes

4. Click 'Save'

Nice mod, thanks










privacy (GDPR)