jr-paperclip 8.0.7 → 8.0.8

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: c6f82555ee3f8910d061b36b9aadf5191e6a25e0bfd3d76f6022405a43020784
4
- data.tar.gz: 82816bd5d6e23b6104a4b518e1b24e3945503878deac4761ec5312fe252548dd
3
+ metadata.gz: 0bf6d2199b379f319c4424dd1b25d19d31a8b75cfd3b8eadc7a55d1d10251a5b
4
+ data.tar.gz: 7c477097c4d74ca8714efdd8c5e165d9bf78f431c6d1896853f7f10cee65022d
5
5
  SHA512:
6
- metadata.gz: 7b42267a2e65083835fcf28041042c6dff92e953ffac30e25ebd55ae74c1d341a88b9f9176bda59ab2751c464230e60f87f4ed2a3c9d874ebee3c42b4a43ba87
7
- data.tar.gz: 0444c975aa115cf08eb3ead118bfd5bfc4a1119a05f29dc87b3a49bfd7d1cfeb33820ea7c778b75fd3d1aa54c91cbe222fa8bdd18c965556428fb704cc501b2f
6
+ metadata.gz: db924c0c50def20d4159d4733f677bed3e032d73e6095e51fecd8b0f8cd4fd65fa3b2505ad31fe479be2df16694b964def07e90e7ae2ee1b5021632b35adf74d
7
+ data.tar.gz: 3ea4b022b05429712551a77322d70d40339728f3e24df68841e2da9f44342324682b97081f6e58bef27072e2480231f996672cd274c939d8426ef9b7c7a120a2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ 8.0.8 (2026-10-21)
2
+
3
+ * Performance: Let eligible vips resizes use native file thumbnailing instead of loading and
4
+ autorotating the full-resolution image first. Explicit source loader options and frame selection
5
+ still take precedence. Native thumbnailing can change resampling and output dimension rounding;
6
+ requested geometry and encoder settings are unchanged. Explicit sequential access retains the old path.
7
+ * Bugfix: Honor auto_orient: false with vips, including image_processing's fallback autorotation.
8
+
1
9
  8.0.7 (2026-06-11)
2
10
 
3
11
  * Performance: Fix repeated animation probing in Thumbnail.
@@ -190,21 +190,7 @@ module Paperclip
190
190
  def build_pipeline(source_path)
191
191
  pipeline = image_processing_module.source(source_path)
192
192
 
193
- # Auto-orient based on EXIF data
194
- if auto_orient
195
- if backend == :vips
196
- pipeline = pipeline.loader(autorotate: true)
197
- elsif backend == :image_magick
198
- pipeline = pipeline.auto_orient
199
- end
200
- end
201
-
202
- # For vips backend, default to sequential access for better memory efficiency.
203
- # Sequential access streams the image from top to bottom, keeping only a few
204
- # scanlines in memory. Users can override via source_file_options: { access: :random }
205
- if backend == :vips
206
- pipeline = pipeline.loader(access: :sequential)
207
- end
193
+ pipeline = pipeline.loader(auto_orient: auto_orient) if backend == :image_magick
208
194
 
209
195
  # Handle source file options
210
196
  if @source_file_options
@@ -238,6 +224,18 @@ module Paperclip
238
224
  pipeline = apply_resize(pipeline)
239
225
  end
240
226
 
227
+ if backend == :vips
228
+ # An empty loader lets image_processing use file thumbnailing, which shrinks
229
+ # before autorotating and uses sequential decoding internally. Keep explicit
230
+ # loaders and frame selection unchanged.
231
+ resize_on_load = pipeline.options[:operations].dig(0, 0).to_s.start_with?("resize_")
232
+ unless auto_orient && resize_on_load && pipeline.options[:loader].empty?
233
+ defaults = { access: :sequential }
234
+ defaults.merge!(auto_orient ? { autorotate: true } : { autorot: false })
235
+ pipeline = pipeline.loader(**defaults.merge(pipeline.options[:loader]))
236
+ end
237
+ end
238
+
241
239
  # Handle animated images (GIF, WebP)
242
240
  if animated?
243
241
  if backend == :image_magick
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperclip
4
- VERSION = "8.0.7"
4
+ VERSION = "8.0.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jr-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.7
4
+ version: 8.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jukka Rautanen
@@ -527,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
527
527
  version: '0'
528
528
  requirements:
529
529
  - ImageMagick or libvips
530
- rubygems_version: 4.0.10
530
+ rubygems_version: 4.0.20
531
531
  specification_version: 4
532
532
  summary: File attachments as attributes for ActiveRecord
533
533
  test_files: []