News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Signature image settings.

Started by Tetrahydrocannabinol, July 25, 2014, 04:26:13 PM

Previous topic - Next topic

Tetrahydrocannabinol

I'm a member of a popular community, that has rather strict settings on signatures  :(
Well, I was told they would lighten up the restrictions, if I could write the code for the feature.

This is a quote from the conversation, and if anyone on here is on those boards they probably know exactly who I took this from.

Quote
1. GIFs: You can disallow remote images to end in .gif, doesn't matter, you make a remote .jpg, firefox sees it's *really* a .gif and animates it anyway.  You download the remote .gif and check, they change it later.
2. Size: You add width/height to the image tag, the browser still has to download a 20mb 40 megapixel image and just resize it, page load times crawl.

The only way to implement any of these checks in a sane way is similar to how avatars work, you have to write code to allow people to upload images, then you can see if they are gifs and re-size them accordingly.

So basically. I need to make it so when people put a single, non-animated, image into their signature. And I need to add size constraints (not just scaling the image down, but actually making a copy of it in the limited size if it's too big).

I know php has a function to check the image type, but I don't know how I would modify the code to allow uploading of images.

Advertisement: