News:

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

Main Menu

GIF icons in standard Curve theme

Started by Malamut, January 07, 2012, 03:37:27 AM

Previous topic - Next topic

Malamut

I think it's a time to completely remove all GIF icons from standard SMF theme. Icons and smilies in Curve theme now look so old and so poorly, that absolutely spoil the impression of the theme. And it's because SMF use obsolete image format, which doesn't support alpha-channel. IE6 now is entirely die (<1%), so there is no reason not to use PNG for all images.

Benefits of using PNG by default:

- Smallest size.
- An ability to create acceptable-looking icons.
- Alpha-channel! (it's absolutely necessary in modern web).
- Most important for me: theme authors no longer have to rewrite virtually all of the standard templates only to replace GIF with PNG.

Because of features of GIF, forum theme can't look good with GIF icons. It's very easy to replace .gif in source files to .png and to convert all images. It'll be breake a lot of themes with custom templates and a lot of mods, but you must do it sooner or later. So I think that it'll be good to do it sooner. E.g in 2.1 version.

Malamut

#1
P.S. The easest way not to break backwards compatibility with most of themes and mods is to add new setting to theme: which type of icons to use - GIF or PNG.

P.P.S. Or, it's the best solution I think, you can add and ability to select icon pack for forum. It can be very usefull.

Antechinus

Quote from: Malamut on January 07, 2012, 03:37:27 AMSo I think that it'll be good to do it sooner. E.g in 2.1 version.

You are a bit behind the times. We're way ahead of you. ;)

http://dev.simplemachines.org/mantis/view.php?id=4714

Malamut

Cool! I'm really waiting 2.1, PNG icons will be the most important thing for me!

IchBin™

Quote from: Malamut on January 07, 2012, 08:35:46 AM
Cool! I'm really waiting 2.1, PNG icons will be the most important thing for me!

Why is that so important for you? Just curious...
IchBin™        TinyPortal

Malamut

Quote from: IchBin™ on January 07, 2012, 06:13:11 PM
Why is that so important for you? Just curious...
Very simple: SMF 2 has all major functions, except good theme customization. I've set up functionality of my forum, but now I can't change some parts of it appearance in a acceptable way. E.g. I can't change icons without rewriting all theme files.

IchBin™

Well that doesn't make much sense to me, but I'll take your word for it! :)
IchBin™        TinyPortal

Antechinus

I know what he means. The standard gif icons are way out of date for image quality on a variety of backgrounds. We did think of changing them all to png for 2.0, but had too much to do anyway. Having them all png would be a great bonus for custom theming, but at the moment requires digging into a lot of files to rewrite the image calls from gif to png. So yes, I can understand why he regards this as important. Themers would totally love all the icons to be png by default.

emanuele

Add this function at the end of QueryString.php:
function gif_replace_integrate($buffer)
{
global $settings;

return preg_replace('~' . $settings['images_url'] . '^(?:(?!bbc).)*\.gif~', $settings['images_url'] . '$1.png', $buffer);
}


and just before (same file):
// Return the changed buffer.
add this:
$buffer = gif_replace_integrate($buffer);
Is designed to work with hook, so you can add it to integrate_buffer and it will work the same.

Hopefully this should change most of the gif with png for all the themes (bbc icons (those in the editor) are excluded, maybe few that should not be changed are changed as well...don't know).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Malamut

emanuele,
Many thanks! I will necessarily try this way in the near future!

Malamut

Some comments:

replace string should be like this:


return preg_replace('~"' . $settings['images_url'] . '/(?!loading|bbc/)([^"]+?)\.gif"~', '"' . $settings['images_url'] . '/$1.png"', $buffer);

Advertisement: