riiif 2.8.0 → 2.8.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 +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ruby.yml +3 -3
- data/Gemfile +2 -5
- data/app/extractors/riiif/vips_info_extractor.rb +1 -1
- data/lib/riiif/version.rb +1 -1
- data/spec/extractors/riiif/vips_info_extractor_spec.rb +26 -4
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c83cf037ced763741c5aa704db17564fd43ee2610866d27629b1de4700c518a
|
|
4
|
+
data.tar.gz: 447135b1b851c29969cd42a91a51b26facb1084b47dc246422b11a15de0dcbc5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86952c0517dfd44217aee70ae4927209aaa7c4078c9142126a6f0a06fe831774371dffb0191c2719cb868249b98b324cbfbf7853c2518622bb67dc2d1afab182
|
|
7
|
+
data.tar.gz: f315b4762cf831614a80728ac072678ea4ad9f1fc38cbc836cd7f6e3eaf6c2009b870682e0024d4cebca02c9da919a33dde3b66bcd98ac8da5f2f4d5691b23fd
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -18,12 +18,12 @@ jobs:
|
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
strategy:
|
|
20
20
|
matrix:
|
|
21
|
-
ruby: ["3.2", "3.3"]
|
|
22
|
-
rails: ["8.
|
|
21
|
+
ruby: ["3.2", "3.3", "3.4"]
|
|
22
|
+
rails: ["8.1.1", "8.0.4", "7.2.3"]
|
|
23
23
|
steps:
|
|
24
24
|
- name: Install ImageMagick
|
|
25
25
|
run: sudo apt install imagemagick
|
|
26
|
-
- uses: actions/checkout@
|
|
26
|
+
- uses: actions/checkout@v6
|
|
27
27
|
- name: Set up Ruby
|
|
28
28
|
uses: ruby/setup-ruby@v1
|
|
29
29
|
with:
|
data/Gemfile
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
gem 'byebug'
|
|
4
3
|
# Specify your gem's dependencies in riiif.gemspec
|
|
5
4
|
gemspec
|
|
6
5
|
|
|
7
6
|
# BEGIN ENGINE_CART BLOCK
|
|
8
|
-
# engine_cart: 2.0
|
|
9
|
-
# engine_cart stanza:
|
|
7
|
+
# engine_cart: 2.6.0
|
|
8
|
+
# engine_cart stanza: 2.5.0
|
|
10
9
|
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
|
11
10
|
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
|
|
12
11
|
if File.exist?(file)
|
|
@@ -27,7 +26,5 @@ else
|
|
|
27
26
|
gem 'rails', ENV['RAILS_VERSION']
|
|
28
27
|
end
|
|
29
28
|
end
|
|
30
|
-
|
|
31
|
-
gem 'sass-rails', '~> 5.0'
|
|
32
29
|
end
|
|
33
30
|
# END ENGINE_CART BLOCK
|
|
@@ -8,7 +8,7 @@ module Riiif
|
|
|
8
8
|
def extract
|
|
9
9
|
attributes = Riiif::CommandRunner.execute("#{external_command} '#{@path}' -a")
|
|
10
10
|
.split(/\n/)
|
|
11
|
-
.map { |str| str.strip.split(': ') }.to_h
|
|
11
|
+
.map { |str| str.strip.split(': ', 2) }.to_h
|
|
12
12
|
width, height = attributes.values_at("width", "height")
|
|
13
13
|
|
|
14
14
|
{
|
data/lib/riiif/version.rb
CHANGED
|
@@ -36,10 +36,10 @@ RSpec.describe Riiif::VipsInfoExtractor do
|
|
|
36
36
|
|
|
37
37
|
let(:fake_info) do
|
|
38
38
|
"width: 50
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
height: 50
|
|
40
|
+
interpretation: srgb
|
|
41
|
+
filename: spec/fixtures/test.tif
|
|
42
|
+
vips-loader: pngload"
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it 'returns the extracted attributes' do
|
|
@@ -51,4 +51,26 @@ RSpec.describe Riiif::VipsInfoExtractor do
|
|
|
51
51
|
})
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
|
+
|
|
55
|
+
context 'on a JPEG file with extra EXIF metadata' do
|
|
56
|
+
let(:image) { double(has_alpha?: false) }
|
|
57
|
+
|
|
58
|
+
let(:fake_info) do
|
|
59
|
+
"width: 150
|
|
60
|
+
height: 150
|
|
61
|
+
interpretation: srgb
|
|
62
|
+
filename: spec/fixtures/test.jpeg
|
|
63
|
+
vips-loader: jpegload
|
|
64
|
+
exif-ifd0-Artist: University Library (Digital Object: Digital Media Group)"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'returns the extracted attributes' do
|
|
68
|
+
expect(described_class.new(image).extract).to eq({
|
|
69
|
+
height: 150,
|
|
70
|
+
width: 150,
|
|
71
|
+
format: "JPEG",
|
|
72
|
+
channels: "srgb"
|
|
73
|
+
})
|
|
74
|
+
end
|
|
75
|
+
end
|
|
54
76
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: riiif
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
@@ -176,6 +176,7 @@ executables: []
|
|
|
176
176
|
extensions: []
|
|
177
177
|
extra_rdoc_files: []
|
|
178
178
|
files:
|
|
179
|
+
- ".github/dependabot.yml"
|
|
179
180
|
- ".github/workflows/ruby.yml"
|
|
180
181
|
- ".gitignore"
|
|
181
182
|
- ".rspec"
|
|
@@ -257,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
257
258
|
- !ruby/object:Gem::Version
|
|
258
259
|
version: '0'
|
|
259
260
|
requirements: []
|
|
260
|
-
rubygems_version:
|
|
261
|
+
rubygems_version: 4.0.7
|
|
261
262
|
specification_version: 4
|
|
262
263
|
summary: A Rails engine that support IIIF requests
|
|
263
264
|
test_files:
|