dragonfly_libvips 2.5.1 → 2.6.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
  SHA256:
3
- metadata.gz: ff758f1df0a5d5e76957e22e4408a990e16e2e80627b4c1cc29fbe5fd8e2a6ac
4
- data.tar.gz: ccb9ffe5f11e224e4672994f84dd48e3dd5157205ccac4acc543b23c51c71230
3
+ metadata.gz: ac08b81580206004f1709059bb96da651d90e5e8868180034ed75456f41f63e9
4
+ data.tar.gz: ff3c231366b1e0da6b958e5c5527fd3294d78e416efd233dda967cb31dcf413e
5
5
  SHA512:
6
- metadata.gz: 2c23ab254f3191a1c65db60aeab578aa3be6365d7cd24ce98a1ed80f08d3eed6557d4b9126cf9ff0b76e82e499d605c54dbf0c2ba4b79ac11fe7dfe67607f885
7
- data.tar.gz: 3c97170ab5e17b824843e2936f9ddd2298b4a8fc1a8f1d48f8ddff166cbf6a7f092f71e16e932fb58f2b600661a701898094d1c13194c5c6fd2d112cb103fe5c
6
+ metadata.gz: 1713ef73b5bf75c09c8bb6dabfacc44e4dd182027a1e07739e909cc6342e5a23216ba17d071548f64c4c127a2b874ef90fff6d12ec75e1544d609c69319ce871
7
+ data.tar.gz: d7fc776e24bf6c08c184d3db39673226e902b6618ef3f617558aab57fae57b4e6011c60227afae3e86dfc0d7279f847d1b2aef8abbc84ef15d69d2bc1924323c
@@ -1,22 +1,22 @@
1
1
  name: Test
2
- on: [push, pull_request]
2
+ on:
3
+ pull_request:
4
+ branches: ["master"]
5
+ push:
6
+ branches: ["master"]
3
7
  jobs:
4
8
  test:
5
9
  runs-on: ubuntu-latest
6
10
  strategy:
7
11
  matrix:
8
- ruby: ['2.7', '3.2']
12
+ ruby: ['3.2', '3.3', '3.4']
9
13
  steps:
10
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v5
11
15
  - name: Install dependencies
12
16
  run: |
13
17
  sudo apt-get clean
14
18
  sudo apt-get update
15
- sudo apt-get install -y gobject-introspection libgirepository1.0-dev libglib2.0-dev libpoppler-glib-dev libgif-dev
16
- curl -OL https://github.com/libvips/libvips/releases/download/v8.13.3/vips-8.13.3.tar.gz
17
- tar zxvf vips-8.13.3.tar.gz && cd vips-8.13.3 && ./configure $1 && sudo make && sudo make install
18
- export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/
19
- sudo ldconfig
19
+ sudo apt-get install -y gobject-introspection libgirepository1.0-dev libglib2.0-dev libpoppler-glib-dev libgif-dev libvips-tools
20
20
  - uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.4.5
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.6.3
1
+ ruby 3.4.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.6.1
4
+
5
+ * Fix auto_profile implementation in thumb processor by @asgerb
6
+
7
+ ## 2.6.0
8
+
9
+ * Add auto_profile configuration option by @asgerb
10
+ * Fix output not having the ICC profile embedded by @asgerb
11
+
3
12
  ## 2.5.1
4
13
 
5
14
  * Update all DragonflyLibvips.symbolize_keys to new syntax by @Bartuz
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "dragonfly", "~> 1.0"
23
23
  spec.add_dependency "ruby-vips", "~> 2.0", ">= 2.0.16"
24
+ spec.add_dependency "base64"
24
25
 
25
26
  spec.add_development_dependency "bundler" # , '~> 2.0'
26
27
  spec.add_development_dependency "rb-readline"
@@ -29,7 +30,6 @@ Gem::Specification.new do |spec|
29
30
  spec.add_development_dependency "minitest", "~> 5.0"
30
31
  spec.add_development_dependency "minitest-reporters"
31
32
  spec.add_development_dependency "rake"
32
-
33
33
  spec.add_development_dependency "lefthook"
34
34
  spec.add_development_dependency "rubocop-rails_config"
35
35
  end
@@ -29,6 +29,7 @@ module DragonflyLibvips
29
29
  "height" => height,
30
30
  "xres" => xres,
31
31
  "yres" => yres,
32
+ "has_alpha" => img.has_alpha?,
32
33
  "progressive" => (content.mime_type == "image/jpeg" && img.get("jpeg-multiscan") != 0)
33
34
  }
34
35
  end
@@ -32,7 +32,7 @@ module DragonflyLibvips
32
32
  output_options = options.fetch("output_options", {})
33
33
  if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
34
34
  output_options.delete("profile")
35
- else
35
+ elsif DragonflyLibvips.auto_profile
36
36
  output_options["profile"] ||= input_options.fetch("profile", EPROFILE_PATH)
37
37
  end
38
38
  output_options.delete("Q") unless /jpg|jpeg/i.match?(format.to_s)
@@ -40,6 +40,15 @@ module DragonflyLibvips
40
40
 
41
41
  img = ::Vips::Image.new_from_file(content.path, **DragonflyLibvips.symbolize_keys(input_options))
42
42
 
43
+ if output_options.include?("profile")
44
+ img = img.icc_transform(
45
+ output_options["profile"],
46
+ embedded: true,
47
+ intent: :relative,
48
+ black_point_compensation: true
49
+ )
50
+ end
51
+
43
52
  content.update(
44
53
  img.write_to_buffer(".#{format}", **DragonflyLibvips.symbolize_keys(output_options)),
45
54
  "name" => "temp.#{format}",
@@ -22,7 +22,7 @@ module DragonflyLibvips
22
22
  output_options = options.fetch("output_options", {})
23
23
  if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
24
24
  output_options.delete("profile")
25
- else
25
+ elsif DragonflyLibvips.auto_profile
26
26
  output_options["profile"] ||= input_options.fetch("profile", EPROFILE_PATH)
27
27
  end
28
28
  output_options.delete("Q") unless /jpg|jpeg/i.match?(format.to_s)
@@ -31,6 +31,15 @@ module DragonflyLibvips
31
31
  img = ::Vips::Image.new_from_file(content.path, **DragonflyLibvips.symbolize_keys(input_options))
32
32
  img = img.extract_area(x, y, width, height)
33
33
 
34
+ if output_options.include?("profile")
35
+ img = img.icc_transform(
36
+ output_options["profile"],
37
+ embedded: true,
38
+ intent: :relative,
39
+ black_point_compensation: true
40
+ )
41
+ end
42
+
34
43
  content.update(
35
44
  img.write_to_buffer(".#{format}", **DragonflyLibvips.symbolize_keys(output_options)),
36
45
  "name" => "temp.#{format}",
@@ -22,7 +22,7 @@ module DragonflyLibvips
22
22
  output_options = options.fetch("output_options", {})
23
23
  if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
24
24
  output_options.delete("profile")
25
- else
25
+ elsif DragonflyLibvips.auto_profile
26
26
  output_options["profile"] ||= input_options.fetch("profile", EPROFILE_PATH)
27
27
  end
28
28
  output_options.delete("Q") unless /jpg|jpeg/i.match?(format.to_s)
@@ -31,6 +31,15 @@ module DragonflyLibvips
31
31
  img = ::Vips::Image.new_from_file(content.path, **DragonflyLibvips.symbolize_keys(input_options))
32
32
  img = img.rot("d#{rotate}")
33
33
 
34
+ if output_options.include?("profile")
35
+ img = img.icc_transform(
36
+ output_options["profile"],
37
+ embedded: true,
38
+ intent: :relative,
39
+ black_point_compensation: true
40
+ )
41
+ end
42
+
34
43
  content.update(
35
44
  img.write_to_buffer(".#{format}", **DragonflyLibvips.symbolize_keys(output_options)),
36
45
  "name" => "temp.#{format}",
@@ -34,7 +34,7 @@ module DragonflyLibvips
34
34
  output_options = options.fetch("output_options", {})
35
35
  if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
36
36
  output_options.delete("profile")
37
- else
37
+ elsif DragonflyLibvips.auto_profile
38
38
  output_options["profile"] ||= input_options.fetch("profile", EPROFILE_PATH)
39
39
  end
40
40
  output_options.delete("Q") unless /jpg|jpeg/i.match?(format.to_s)
@@ -67,6 +67,15 @@ module DragonflyLibvips
67
67
  thumbnail_options = thumbnail_options.transform_keys { |k| k.to_sym } # symbolize
68
68
  thumb = ::Vips::Image.thumbnail(filename, dimensions.width.ceil, **DragonflyLibvips.symbolize_keys(thumbnail_options))
69
69
 
70
+ if output_options.include?("profile")
71
+ thumb = thumb.icc_transform(
72
+ output_options["profile"],
73
+ embedded: true,
74
+ intent: :relative,
75
+ black_point_compensation: true
76
+ )
77
+ end
78
+
70
79
  content.update(
71
80
  thumb.write_to_buffer(".#{format}", **DragonflyLibvips.symbolize_keys(output_options)),
72
81
  "name" => "temp.#{format}",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DragonflyLibvips
4
- VERSION = "2.5.1"
4
+ VERSION = "2.6.1"
5
5
  end
@@ -54,6 +54,13 @@ module DragonflyLibvips
54
54
  webp
55
55
  ]
56
56
 
57
+ class << self
58
+ # Controls whether output images automatically get an ICC profile attached
59
+ attr_accessor :auto_profile
60
+ end
61
+
62
+ self.auto_profile ||= true
63
+
57
64
  private
58
65
  def self.stringify_keys(hash = {})
59
66
  hash.transform_keys { |k| k.to_s }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly_libvips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-02-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dragonfly
@@ -44,6 +43,20 @@ dependencies:
44
43
  - - ">="
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.0.16
46
+ - !ruby/object:Gem::Dependency
47
+ name: base64
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ type: :runtime
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
47
60
  - !ruby/object:Gem::Dependency
48
61
  name: bundler
49
62
  requirement: !ruby/object:Gem::Requirement
@@ -170,7 +183,6 @@ dependencies:
170
183
  - - ">="
171
184
  - !ruby/object:Gem::Version
172
185
  version: '0'
173
- description:
174
186
  email:
175
187
  - tomas.celizna@gmail.com
176
188
  executables: []
@@ -218,7 +230,6 @@ homepage: https://github.com/tomasc/dragonfly_libvips
218
230
  licenses:
219
231
  - MIT
220
232
  metadata: {}
221
- post_install_message:
222
233
  rdoc_options: []
223
234
  require_paths:
224
235
  - lib
@@ -233,8 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
244
  - !ruby/object:Gem::Version
234
245
  version: '0'
235
246
  requirements: []
236
- rubygems_version: 3.0.3
237
- signing_key:
247
+ rubygems_version: 3.6.9
238
248
  specification_version: 4
239
249
  summary: Dragonfly analysers and processors for libvips image processing library.
240
250
  test_files: []