Skip to content

Vips::Image#height of thumbnail_image is different in Ubuntu 22.04 #383

@yahonda

Description

@yahonda

Describe the bug
Vips::Image#height of thumbnail_image is different in Ubuntu 22.04

To Reproduce

  1. Install Ruby 3.3.0 on Ubuntu 22.04
$ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
  1. Install the latest ruby-vips
$ gem install ruby-vips
  1. Download the webp file
$ wget https://raw.githubusercontent.com/rails/rails/main/activestorage/test/fixtures/files/valley.webp
  1. Save this file as thumbnail_height.rb
require 'vips'

# Load the input image
input_image = Vips::Image.new_from_file('valley.webp')

# Define the thumbnail width and height
thumbnail_width = 50
thumbnail_height = 50

# Create the thumbnail image
thumbnail_image = input_image.thumbnail_image(thumbnail_width, height: thumbnail_height)
p thumbnail_image.height
  1. Run ruby thumbnail_height.rb
$ ruby thumbnail_height.rb
  1. It returns 34 as the height of the thumbnail
$ ruby thumbnail_height.rb
34

Expected behavior
It should show 33

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • Browser wget is only used to download the test file.
  • Version GNU Wget 1.21.2 built on linux-gnu.

Additional context
This issue is opened while investigating Rails CI isssue
https://buildkite.com/rails/rails-nightly/builds/149#018d9052-1b2d-48fa-9d74-a39df3f3f1d6/1251-1291
It had been working fine, that means the height of the thumbnail had been 33.

I attempt to reproduce this issue using libvips42 only but it does not reproduce.

  • Steps without ruby-vips
$ vipsthumbnail valley.webp -s 50x50
$ identify -format "%h" tn_valley.jpg
33
  • Installed apt packages
$ apt list --installed | grep libvips

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libvips-doc/jammy,now 8.12.1-1build1 all [installed,automatic]
libvips-tools/jammy,now 8.12.1-1build1 arm64 [installed]
libvips42/jammy,now 8.12.1-1build1 arm64 [installed]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions