phash-rb 0.3.0 → 0.3.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: 25abc7a966b034a17a10113432e8135471c109f8b688c4797c5c2fbe676e0e57
4
- data.tar.gz: 4b5220f02a144e1173d1acda79bd92b72885cc5c9c8f81d426f51a6587b9c9de
3
+ metadata.gz: cb8320eac1ac54f8b57ce98e88cefc376c7921e57e3874e40e4bd046544077ad
4
+ data.tar.gz: 62a21503a180cf5c42f5681d661f059032fe37e9947a5037d6dcb53727bb1a8a
5
5
  SHA512:
6
- metadata.gz: 127987f334068eabbf5e92ee67a6b4560338797c59246a55bca2d92193a1776330cd62dda2c8b604ea57aa08dbafb71bd831bae5fde408fb741c350eb2798651
7
- data.tar.gz: c4a2b91bc23f7ea34eafb4d02e2095ac7153f088f6b0be8ff381016b17e22f940ed9b65b39f831a09d919ce5a19d0cebd429f2a80991f4190505d5e8ed966654
6
+ metadata.gz: 923e41cf1d048b71ca224f47c6809315ce071348e85f916f508c4f1eca9b8a31c2508c9f8a47fd916cb3729b2d0a86010c0f69c67930f874338785ac8bc3ebc0
7
+ data.tar.gz: af270246aaafcd1671a40206fd7d93b7e154a550ad85720769a517227d31ae4e42c4e92f4e845126dfdebcc7cdd23e434db42f10369c3802e977b3efc46bbe65
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ### 0.3.1
6
+
7
+ - Fix fingerprinting for 4-band images (RGBA with alpha channel) on vips 8.15.1+
8
+
5
9
  ### 0.3.0
6
10
 
7
11
  - Optimize fingerprint calculation for large images (~24x faster for images >500x500)
data/lib/phash/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phash
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
data/lib/phash.rb CHANGED
@@ -16,6 +16,8 @@ module Phash
16
16
 
17
17
  def self.fingerprint(path_or_img)
18
18
  img = path_or_img.is_a?(Vips::Image) ? path_or_img : Vips::Image.new_from_file(path_or_img)
19
+ # Strip alpha channel if present (4-band images)
20
+ img = img[0..2] if img.bands == 4
19
21
  #Y = (66*R + 129*G + 25*B + 128)/256 + 16
20
22
  img = img * [66.0 / 256, 129.0 / 256, 25.0 / 256]
21
23
  r, g, b = img.bandsplit
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phash-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Ratajczak
8
8
  - Krzysztof Hasiński
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2025-12-12 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ruby-vips
@@ -64,7 +63,6 @@ metadata:
64
63
  homepage_uri: http://github.com/khasinski/phash-rb
65
64
  source_code_uri: http://github.com/khasinski/phash-rb
66
65
  changelog_uri: http://github.com/khasinski/phash-rb
67
- post_install_message:
68
66
  rdoc_options: []
69
67
  require_paths:
70
68
  - lib
@@ -79,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
77
  - !ruby/object:Gem::Version
80
78
  version: '0'
81
79
  requirements: []
82
- rubygems_version: 3.0.3.1
83
- signing_key:
80
+ rubygems_version: 4.0.2
84
81
  specification_version: 4
85
82
  summary: Ruby implementation of pHash library
86
83
  test_files: []