vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - VB4 + VBSEO] Site Optimization: Easily Specify Image Dimensions (https://vborg.vbsupport.ru/showthread.php?t=276910)

Lazorbeam 01-12-2012 11:00 PM

[HOW TO - VB4 + VBSEO] Site Optimization: Easily Specify Image Dimensions
 
One of the high-impact criteria of a fast web page is whether image dimensions have been specified in html or not. Without image dimensions, web browsers must "reflow" and "repaint" the image once it is reloaded.

The problem is that specifying image dimensions can be tedious. One would be required to edit each template and insert dimensions manually. To make matters worst, there are hundreds (if not thousands) of images in vbulletin, some of which aren't even used. Conventionally, one could run a get image sizes script to pull all images and respective dimensions from vbulletin. This method returns thousands of results, most of which are images with no need to be optimized.

I found a very easy solution using VBSEO. If you don't use VBSEO, this article won't be of much help.
  1. Open up 3 instances of GTmetrix.com.
  2. The first should point to your CMS (if applicable), the 2nd to your forum root, and the third to any PUBLICLY viewable thread.
  3. GTmetrix then grades your site speed against several criteria.
  4. Click on the "specify image dimensions" criteria. Odds are you scored 0 on this.
  5. A list of images come up for each instance of GTmetrix. These are the images that load up on your most popular pages (CMS, FORUMHOME and SHOWTHREAD). You can use GTmetrix to find images on other pages, if you wish, like blogs etc.
  6. Copy paste each list of images into notepad and make sure there are no duplicates.
  7. Log into VBSEO.
  8. Navigate to VBSEO "Other Enhancements" and click on "Image Size Attributes".
  9. Select "Yes". Paste the list of images from your clipboard.
  10. Next, you have to format the list so that VBSEO can understand it. It's relatively simple. For example http://www.example.com/forum/images/smile.png (Dimensions: 728 x 90) would become 'smile.png'=>'728x90'
  11. Note: if you have multiple styles with the same image in each, this will work so long as the image has the same dimensions. Otherwise you will screw up your style.
  12. Note2: Be careful with avatars and other resized images, since they can appear in various sizes throughout your forum. You shouldn't be specifying dimensions for these.
  13. Run GTmetrix to make sure the image dimensions no longer need to be specified.

I haven't figured out how to do google adsense and external images with this method yet.

And that's it! You're done.

garybrun 01-18-2012 05:59 PM

Thanks you for this.
Im looking into it now.

kitawanita 01-22-2012 01:51 AM

Hi Lazorbeam,
I"m using another folder to place my image .ex : http://example.com/newfolder/smile.png
How to write the path in vbseo?
Thanks for any help and sorry for bad english.

Lazorbeam 01-23-2012 11:54 AM

Quote:

Originally Posted by kitawanita (Post 2290799)
Hi Lazorbeam,
I"m using another folder to place my image .ex : http://example.com/newfolder/smile.png
How to write the path in vbseo?
Thanks for any help and sorry for bad english.

You don't have to write a path unless the image name is used in another folder. Example:

http://example.com/newfolder/smile.png
http://example.com/smile.png

You would have to include the path for the images above. Otherwise it's simply /newfolder/smile.png

kitawanita 01-28-2012 09:26 AM

Ok,it works.Thanks :)

FReeSTER 01-30-2012 01:30 AM

this is a great tutorial mate
ty

abdobasha2004 01-31-2012 09:45 AM

great... i will try this after installing vBSEO today ISA
thanks

Mark_Zuckerberg 09-30-2012 08:24 PM

I f not having vbseo then what to do in vb 4.2

Dorgham 02-25-2013 05:38 PM

I also do not have vbseo

watershed 02-27-2013 02:52 PM

I have used this and managed to remove some of the images from the list, yet i'm still getting an F (0) result for this test.

Some of the files I hadn't removed were avatars/avatar thumbnails (As instructed). I've also not managed to specify sizes of files which do not sit on my website.

Any idea as to why this is?

I can give you my url in private to have a look if you want :)

Thanks!

Lazorbeam 02-28-2013 05:46 PM

Quote:

Originally Posted by watershed (Post 2406734)
I have used this and managed to remove some of the images from the list, yet i'm still getting an F (0) result for this test.

Some of the files I hadn't removed were avatars/avatar thumbnails (As instructed). I've also not managed to specify sizes of files which do not sit on my website.

Any idea as to why this is?

I can give you my url in private to have a look if you want :)

Thanks!

The way GTMetrix grades this criteria is weird. If you have a few images without dimensions, you will grade poorly, even if 99% of your images are OK. I imagine your avatars are screwing up the page. Maybe try a page without avatars.

You can do avatars and profile pictures, but it's a somewhat futile exercise because there are thousands (for me, at least) cycling through your pages.

datoneer 03-11-2013 03:58 AM

Great thanks!

final kaoss 07-09-2013 01:38 PM

If only there were a mod to automate this process for every image....


All times are GMT. The time now is 11:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01104 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete