vips-thumbnail 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d4bfaf97d75cf13a513d6280f4afb9ed438e4cb
4
- data.tar.gz: bb8f1f40de09916e95fe04dbcca29244bb81544d
3
+ metadata.gz: 1e5df416590d90a76c603ec1552c1bd3505ed428
4
+ data.tar.gz: 2bd71952ab956467c481434a400fa6012441a7f5
5
5
  SHA512:
6
- metadata.gz: 4d973f0b0221b82de7f2c43b9259f81a2b6f65dde6ebe9cf20d25503a60eb00cd665b91aa1da701215b05fa861c42f0cb5d3b7c2d96fbca61bc60b244caebbbc
7
- data.tar.gz: 238c3206f041ec8fd878002b96f0bd63b0cfc4d6ab390bf53485d9e857fbc53b7a4ebc87ece9bfca410209553d96f2fdaf713b82b62268cbe8af0a9dc0476229
6
+ metadata.gz: ca4fee62063b6a361b8ade7668d4594d22d19c5e30b99eba047b53395317772d1fa371200be7cc5f080a294f571ad7974121f122172bdc549ed623abe29cccdc
7
+ data.tar.gz: 52475f522e4af56807ec7839d5c871e1f89de84869122393b4c44724bf1910d76955996c746d7e8411153e17600f1f8290be9b969ec7a455621c0cc0aa50a8ca
@@ -1,31 +1,7 @@
1
- language: ruby
2
- dist: trusty
3
- sudo: true
4
- rvm:
5
- - 2.1.8
6
- - 2.2.4
7
- - 2.3.0
8
- - 2.4.0
9
- - ruby-head
10
- - rbx-2
11
- env:
12
- - COVERAGE=true LIBVIPS=8.4.4
13
- matrix:
14
- allow_failures:
15
- - rvm: "rbx-2"
16
- - rvm: "ruby-head"
17
-
18
1
  # Copied from https://github.com/jcupitt/ruby-vips/blob/master/.travis.yml
19
- before_install:
20
- - wget http://www.vips.ecs.soton.ac.uk/supported/current/vips-$LIBVIPS.tar.gz
21
- - tar xvf vips-$LIBVIPS.tar.gz
22
- - cd vips-$LIBVIPS
23
- - >
24
- CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
25
- ./configure --prefix=/usr
26
- - make
27
- - sudo make install
28
- - sudo ldconfig
2
+ sudo: false
3
+
4
+ dist: trusty
29
5
 
30
6
  addons:
31
7
  apt:
@@ -49,3 +25,26 @@ addons:
49
25
  - libpoppler-glib-dev
50
26
  - libwebp-dev
51
27
  - libglib2.0-dev
28
+
29
+ cache:
30
+ directories:
31
+ - $HOME/vips
32
+
33
+ before_install:
34
+ - source install-vips.sh
35
+
36
+ rvm:
37
+ - 2.1.8
38
+ - 2.2.4
39
+ - 2.3.0
40
+ - 2.4.0
41
+ - ruby-head
42
+ - rbx-2
43
+
44
+ env:
45
+ - COVERAGE=true
46
+
47
+ matrix:
48
+ allow_failures:
49
+ - rvm: "rbx-2"
50
+ - rvm: "ruby-head"
data/Gemfile CHANGED
@@ -3,7 +3,6 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in vips-thumbnail.gemspec
4
4
  gemspec
5
5
 
6
-
7
6
  group :development do
8
7
  end
9
8
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vips::Thumbnail
2
2
 
3
- An easy to use thumbnail resizer. It's based on libvips so it's fast.
3
+ An easy to use thumbnail resizer. It's based on libvips so it's [faster than everything else](http://www.vips.ecs.soton.ac.uk/index.php?title=Speed_and_Memory_Use).
4
4
 
5
5
  [![Build Status](https://secure.travis-ci.org/ioquatix/vips-thumbnail.svg)](http://travis-ci.org/ioquatix/vips-thumbnail)
6
6
  [![Code Climate](https://codeclimate.com/github/ioquatix/vips-thumbnail.svg)](https://codeclimate.com/github/ioquatix/vips-thumbnail)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+
3
+ export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
4
+ export VIPS_SITE=http://www.vips.ecs.soton.ac.uk/supported
5
+ export VIPS_VERSION_MAJOR=8
6
+ export VIPS_VERSION_MINOR=4
7
+ export VIPS_VERSION_MICRO=5
8
+ export VIPS_VERSION=$VIPS_VERSION_MAJOR.$VIPS_VERSION_MINOR
9
+ export VIPS_VERSION_FULL=$VIPS_VERSION.$VIPS_VERSION_MICRO
10
+ export PATH=$HOME/vips/bin:$PATH
11
+ export LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH
12
+ export PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig:$PKG_CONFIG_PATH
13
+ export PYTHONPATH=$HOME/vips/lib/python2.7/site-packages:$PYTHONPATH
14
+ export GI_TYPELIB_PATH=$HOME/vips/lib/girepository-1.0:$GI_TYPELIB_PATH
15
+
16
+ set -e
17
+
18
+ # do we already have the correct vips built? early exit if yes
19
+ # we could check the configure params as well I guess
20
+ if [ -d "$HOME/vips/bin" ]; then
21
+ version=$($HOME/vips/bin/vips --version)
22
+ escaped_version="$VIPS_VERSION_MAJOR\.$VIPS_VERSION_MINOR\.$VIPS_VERSION_MICRO"
23
+ echo "Need vips-$VIPS_VERSION_FULL"
24
+ echo "Found $version"
25
+ if [[ "$version" =~ ^vips-$escaped_version ]]; then
26
+ echo "Using cached directory"
27
+ exit 0
28
+ fi
29
+ fi
30
+
31
+ rm -rf $HOME/vips
32
+ wget $VIPS_SITE/$VIPS_VERSION/vips-$VIPS_VERSION_FULL.tar.gz
33
+ tar xf vips-$VIPS_VERSION_FULL.tar.gz
34
+ cd vips-$VIPS_VERSION_FULL
35
+ CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ./configure --prefix=$HOME/vips $*
36
+ make && make install
@@ -39,6 +39,10 @@ module Vips
39
39
  return @input_image
40
40
  end
41
41
 
42
+ def input_aspect_ratio
43
+ Rational(input_image.width, input_image.height)
44
+ end
45
+
42
46
  # Resize the image to completely fill the desired size, if possible.
43
47
  # @return [Vips::Image] if the image could be resized, otherwise `nil`.
44
48
  def resize_to_fill(output_size)
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Vips
22
22
  module Thumbnail
23
- VERSION = "1.0.0"
23
+ VERSION = "1.0.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vips-thumbnail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-22 00:00:00.000000000 Z
11
+ date: 2017-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-vips
@@ -79,6 +79,7 @@ files:
79
79
  - Gemfile
80
80
  - README.md
81
81
  - Rakefile
82
+ - install-vips.sh
82
83
  - lib/vips/thumbnail.rb
83
84
  - lib/vips/thumbnail/resizer.rb
84
85
  - lib/vips/thumbnail/version.rb