MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / calculateHash

Method calculateHash

testutil/image_hash_cache_matcher.go:109–117  ·  view source on GitHub ↗

calculateHash converts image data to RGBA using VIPS and calculates hash

(t *testing.T, buf []byte)

Source from the content-addressed store, hash-verified

107
108// calculateHash converts image data to RGBA using VIPS and calculates hash
109func (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.

Callers 1

ImageMatchesMethod · 0.95

Calls 1

NewImageHashFromBytesFunction · 0.85

Tested by

no test coverage detected