Skip to content

Commit

Permalink
Cut version 2.1.0
Browse files Browse the repository at this point in the history
- Additionally make some small formatting changes
- Loosen rubocop restrictions. A younger, more idealistic me thought
  they were a good idea.
  • Loading branch information
rbuchberger committed Jan 29, 2024
1 parent a632f6f commit 4c516b5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 33 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ AllCops:
- '**/vendor/**/*'

Layout/LineLength:
Max: 80
Max: 120

# Disabled Cops
Style/FrozenStringLiteralComment:
Enabled: false

Style/StringConcatenation:
Enabled: false

Metrics/MethodLength:
Enabled: false
4 changes: 4 additions & 0 deletions docs/devs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
---
# Release History

* 2.1.0 29 January, 2024
* Check whether the vips CLI is installed before trying to use it. Thanks to @philrb for
[#299](https://github.com/rbuchberger/jekyll_picture_tag/pull/299)
* Update minimum required mocha version to maintain compatibility with minitest
* 2.0.4 August 16, 2022
* Fix backend format support detection for new versions of libvips & imagemagick
* 2.0.3 April 1, 2021
Expand Down
44 changes: 22 additions & 22 deletions lib/jekyll_picture_tag/parsers/image_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ def handler_for(format)

# Returns array of formats that vips can save to
def vips_formats
if command?("vips")
if command?('vips')
@vips_formats ||= `vips -l`
.split("/n")
.select { |line| line.include? "ForeignSave" }
.flat_map { |line| line.scan(/\.[a-z]{1,5}/) }
.map { |format| format.strip.delete_prefix(".") }
.uniq
.split('/n')
.select { |line| line.include? 'ForeignSave' }
.flat_map { |line| line.scan(/\.[a-z]{1,5}/) }
.map { |format| format.strip.delete_prefix('.') }
.uniq
else
@vips_formats = []
end
end

# Returns an array of formats that imagemagick can handle.
def magick_formats
if command?("convert")
if command?('convert')
@magick_formats ||= `convert -version`
.scan(/Delegates.*/)
.first
.delete_prefix("Delegates (built-in):")
.split
.scan(/Delegates.*/)
.first
.delete_prefix('Delegates (built-in):')
.split
else
@magick_formats = []
end
Expand All @@ -51,17 +51,17 @@ def all_names(format)
def error_string(format)
str = []
str << "No support for generating \"#{format}\" files in this environment!"
if command?("vips")
str << "Libvips (installed) supports: \"#{vips_formats.join(", ")}\"."
else
str << "Libvips is not installed."
end
if command?("convert")
str << "Imagemagick (installed) supports: \"#{magick_formats.join(", ")}\"."
else
str << "Imagemagick is not installed."
end
str.join(" ")
str << if command?('vips')
"Libvips (installed) supports: \"#{vips_formats.join(', ')}\"."
else
'Libvips is not installed.'
end
str << if command?('convert')
"Imagemagick (installed) supports: \"#{magick_formats.join(', ')}\"."
else
'Imagemagick is not installed.'
end
str.join(' ')
end

def alternates
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll_picture_tag/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PictureTag
VERSION = '2.0.4'.freeze
VERSION = '2.1.0'.freeze
end
21 changes: 12 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ If you're interested, contact me: robert@buchberger.cc
**Responsive Images done correctly.**

It's simple to throw a photo on a page and call it a day, but doing justice to users on all
different browsers and devices is tedious and tricky. Tedious, tricky things should be automated.
different browsers and devices is tedious and tricky. Tedious, tricky things should be automated.
[This blog post further elaborates on that theme.](https://robert-buchberger.com/blog/2021/responsive_images.html)


Jekyll Picture Tag automatically builds cropped, resized, and reformatted images, builds several
kinds of markup, offers extensive configuration while requiring none, and solves both the art
direction and resolution switching problems with a little YAML configuration and a simple template
Expand Down Expand Up @@ -50,16 +49,20 @@ Tag is your responsive images minion - give it simple instructions and it'll han
* Configure it easily, or not at all.
* Make Lighthouse happy.

## Documentation:
## Documentation

https://rbuchberger.github.io/jekyll_picture_tag/
<https://rbuchberger.github.io/jekyll_picture_tag/>

## Changelog:
## Changelog

https://rbuchberger.github.io/jekyll_picture_tag/devs/releases
<https://rbuchberger.github.io/jekyll_picture_tag/devs/releases>

Recent releases:

* 2.1.0 29 January, 2024
* Check whether the vips CLI is installed before trying to use it. Thanks to @philrb for
[#299](https://github.com/rbuchberger/jekyll_picture_tag/pull/299)
* Update minimum required mocha version to maintain compatibility with minitest
* 2.0.4 August 16, 2022
* Fix backend format support detection for new versions of libvips & imagemagick
* 2.0.3 April 1, 2021
Expand All @@ -82,11 +85,11 @@ Recent releases:
* Require Ruby >= 2.6, support Ruby 3.0
* Require Jekyll >= 4.0
* Cropping is changing.
* We now use the libvips
* We now use the libvips
[smartcrop function](https://www.rubydoc.info/gems/ruby-vips/Vips/Image#smartcrop-instance_method),
which does some magic to keep the most useful part of the image.
* Geometry is renamed to 'crop', and reduced to simple aspect ratios only. (`width:height`)
* Gravity is gone, replaced by 'keep' which is translated to a libvips
* Geometry is renamed to 'crop', and reduced to simple aspect ratios only. (`width:height`)
* Gravity is gone, replaced by 'keep' which is translated to a libvips
[interestingness](https://www.rubydoc.info/gems/ruby-vips/Vips/Interesting) setting.
* Add stock presets and media queries, under the `jpt-` prefix.
* Add `format_quality` default settings for webp, avif, and jp2.
Expand Down

0 comments on commit 4c516b5

Please sign in to comment.