News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Max image width per theme?

Started by Jade Elizabeth, August 07, 2014, 05:44:15 AM

Previous topic - Next topic

Jade Elizabeth

Is there a way to make the max image width work per theme?

I could use css...but I worry that it will make loading slower? Ant where are you when I need your knowledge! :D
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Use CSS. :P What else are you going to do? If you use PHP or js you will just be resizing images on the fly anyway. The resize algorithms in SMF load the full size image. It just looks smaller.

* Antechinus is mostly busy doing non-coding stuffz at the moment

Amil Gaoul

and how do I know the perfect width and height for it?
or even how can I set it to the theme perfect width...

esp if I want to change the background picture of a theme that uses a small picture that's been set to repeat with a full size complete picture.

I made one on PS but when I add it it always looks smaller....
I really am lost in this aspect.

Jade Elizabeth

Quote from: Antechinus on August 07, 2014, 06:29:29 PM
Use CSS. :P What else are you going to do? If you use PHP or js you will just be resizing images on the fly anyway. The resize algorithms in SMF load the full size image. It just looks smaller.

* Antechinus is mostly busy doing non-coding stuffz at the moment

I thought that resizing through HTML was more efficient? Also I want it to work on mobile lol.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Resizing via HTML makes you cache the full-size image, then just displays it scaled down. Byte count and RAM usage is the same as doing it via CSS. Difference is CSS is cached, so you save on HTML. Mobiles do CSS these days. Is your phone one of the old bricks? :D

Jade Elizabeth

Yes and no.

Will it speed it up then, if it's using CSS?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Probably make no noticeable difference.

Dragooon

Quote from: Jade Elizabeth on August 08, 2014, 12:27:32 AM
Quote from: Antechinus on August 07, 2014, 06:29:29 PM
Use CSS. :P What else are you going to do? If you use PHP or js you will just be resizing images on the fly anyway. The resize algorithms in SMF load the full size image. It just looks smaller.

* Antechinus is mostly busy doing non-coding stuffz at the moment

I thought that resizing through HTML was more efficient? Also I want it to work on mobile lol.
Resizing through HTML and CSS should be same internally for modern browsers, making pretty much no difference either way other than a few cached bytes and resizing via CSS/HTML is far faster than JS.

Jade Elizabeth

I thought when HTML did it, it loaded the size firmly even though it was still the fullsized image..

but CSS loaded the fullsized one THEN scaled it. Would that be fair to say? Or has that changed?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Dragooon

Quote from: Jade Elizabeth on August 09, 2014, 10:17:28 PM
I thought when HTML did it, it loaded the size firmly even though it was still the fullsized image..

but CSS loaded the fullsized one THEN scaled it. Would that be fair to say? Or has that changed?
Pretty sure CSS is applied while loading as well, but I haven't confirmed this so I can be wrong.

Advertisement: