Picto thématique

Rule n° 114 - Thumbnails and previews are not larger images resized on the client side.

The HTML language makes it possible to indicate dimensions for an image that are different from those of the original image. This makes it possible to create thumbnails and image previews. For example, you can perfectly display a square image with 100 pixels on each side, whereas it is a square image with 5000 pixels on each side for which you have simply resized the display in HTML. The display is small but the amount of data to download remains the same. This directly affects the performance of the site and thus should be avoided.

#Eco-conception #Images and media #Development

Goal

  • Decrease the amount of data to download.
  • Improve page display speed.
  • Decrease the energy impact related to the consultation of the site.

Implementation

For image preview vignettes, use specific versions of them and not original images resized using their HTML attributes or CSS properties.

Control

For all HTML images present in the source code or generated via javascript:

  • Check that they do not have CSS height or width properties which modify the apparent size of the images in relation to their actual dimensions.To do this, use "deactivate all CSS styles" using a web development tool to find images whose dimensions change after deactivating CSS styles.
  • Also check that the dimensions indicated in the width and height attributes of the generated HTML code correspond to the actual dimensions of the image using a development tool.

For example, the following will be invalidated:

  • An image of the type <img height="300" width="600" class="thumb"/> if the .thumb class imposes the CSS properties height: 100px and width: auto.
  • An image of the type <img height="100" width="200"/> if the actual dimensions of the image are 300px high and 600px wide.

By Opquast - Read the license

Overview and background

The 240 Opquast rules are defined and agreed upon by an extensive community of web professionals and academics. These web quality assurance guidance rules started as a list of best practices 20 years ago. They have since been revised every five years and have been tried and tested via millions of web interactions by Opquast community’s customers, including the leading CMS communities which have developed plugins for WordPress, Drupal and Prestashop. The most recent version, v4, was established in 2020.

Each rule has individual technical sheets and the rules can be searched by project phase or various topics: e-commerce, data-privacy, internationalization, security, code, etc, or by themes: accessibility, SEO, mobile, privacy, and ecodesign. The complete checklist is available on a creative commons license BY-SA.

To learn more about the Opquast approach, read this article published at Smashing Magazine

Broad application and benefits

The rules should be applied to your projects from the design phase through to post-implementation , and they should be understood by all professionals with web and customer experience (CX) responsibilities: from strategy to operations, marketers to project managers, and editorial to technical staff. The benefits of using this ruleset are numerous, including improving customer satisfaction, web performance, and e-commerce, and expanding your client base, while also decreasing your errors and costs.

Multidisciplinary verticles - accessiiblity, SEO, e-commerce, ecodesign etc..- starting from the foundational Opquast base.

Discover Opquast training and certification

The objective of these rules and the Opquast community mission is ‘making the web better’ for your customers and for everyone! Opquast rules cover the key major areas of risk that can negatively affect website users such as privacy, ecodesign, accessibility and security.

Opquast training has already allowed over 17,000 web professionals to have their skills certified. Train your teams, contact us

We offer a 1 hour free discovery module.