Skip to content

1.0.0

Compare
Choose a tag to compare
@gchtr gchtr released this 06 Apr 08:54
· 14 commits to 1.x since this release

Timmy version 1 comes packed with new features and introduces some breaking changes.

  • Fixed a bug when Timmy tried to resize files that it shouldn’t (video files for example).
  • Fixed issue when Timmy created upscaled image files even though it shouldn’t.
  • Added support for lazy loading with loading attribute.
  • Added width and height attributes for images by default to support browsers to calculate an aspect ratio.
  • Added support for WebP images.
  • Added support for getting Timmy image sizes with wp_get_attachment_image_src().
  • Added get_timber_image_alt() function.
  • Added get_timber_image_caption() function.
  • Added get_timber_image_description() function.
  • Added get_timber_picture_responsive() function.
  • Added get_timber_picture_fallback_image() function.
  • Added better support for SVG images. They will also receive width and height attributes if a size can be read from the SVG file.
  • Increased minimum supported PHP version to 7.4.
  • Increased required Timber version to 1.9.
  • Changed oversize configuration option naming from oversize to upscale. You can still use oversize, but it will be deprecated in the future.
  • Improved hints about controlling image sizes for Yoast.

Breaking changes

  • Changed additional parameters that are passed to the timber/src_default filter. There is no longer an array of additional $attributes to this filter, but only an instance of Timmy\Image.
  • Removed function pluggability. This means that you can’t overwrite any Timber functions anymore. If you want a similar functionality, you can copy the functions. They have way less logic in them than before, because a lot of the logic moved to the Timmy\Image class.
  • Removed get_post_thumbnail() and get_post_thumbnail_src() functions, because they are not namespaced with _timber_ as the other functions and are practically the same as get_timber_image() and get_timber_image_src().
  • Removed the title attribute from the <img> attributes, which was added by default with an image’s description. That approach was too opinionated and might only make sense in some use cases. If you still want to somehow use the image description, you can use the get_timber_image_description() function.
  • Removed deprecated get_image_attr_html(), get_timber_image_attr() and get_acf_image_attr() functions.

Changed how Timmy should be initialized.

🚫 Before

new Timmy\Timmy();

✅ After

Timmy\Timmy::init();

Changed how Responsive Content Images should be initialized

🚫 Before

new Timmy\Responsive_Content_Images()

✅ After

Timmy\Timmy::responsive_content_images();

New API behind the scenes

  • Added a new Timmy\Image class that is used to generate the markup for an image. Most of the functionality that was in the get_timber_*() functions before now lives in that class.
  • Added a Timmy\Timmy::get_image() function to get a Timmy\Image in a way that allows developers to extend the Timmy\Image class.

New documentation

What changed since the 1.0.0-beta.3 release

  • Fixed a bug when Timmy tries to resize files that it shouldn’t by @gchtr in #45
  • Fixed a typo in README.md by @hanifbirgani in #42
  • Updated testing setup by @gchtr in #52
  • 1.x Fix bugs for images without metadata by @gchtr in #53
  • 1.x Allow lazy_* args for picture markup by @gchtr in #54
  • 1.x Add an API for image version for dark color schemes by @gchtr in #55
  • 1.x Improve handling of full size images by @gchtr in #56
  • 1.x Fix a bug when Gif images were converted to WebP images by @gchtr in #57
  • 1.x Fix some bugs where Timmy resized images unnecessarily by @gchtr in #58
  • 1.x Add responsive_src() and responsive() methods by @gchtr in #59

Full Changelog

0.14.8...1.0.0