calculateHash converts image data to RGBA using VIPS and calculates hash
(t *testing.T, buf []byte)
| 107 | |
| 108 | // calculateHash converts image data to RGBA using VIPS and calculates hash |
| 109 | func (m *ImageHashCacheMatcher) calculateHash(t *testing.T, buf []byte) *ImageHash { |
| 110 | t.Helper() |
| 111 | |
| 112 | // Calculate hash |
| 113 | hash, err := NewImageHashFromBytes(buf, m.hashType) |
| 114 | require.NoError(t, err) |
| 115 | |
| 116 | return hash |
| 117 | } |
| 118 | |
| 119 | // makeTargetPath creates the target directory and returns file path for saving |
| 120 | // the image or hash. |
no test coverage detected