Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
GMImage.Hash
Calculates a hash of the image.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 9.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
ImageRef | The image reference number. | 1 | |
Size | Available in MBS FileMaker Plugin 12.4 or newer. The size of the bitmap. Value from 8 to 1024. Default is 8. |
Optional |
Result
Returns text or error.
Description
Calculates a hash of the image.Hash is returned as 64 characters being 1 or 0.
We convert image to 8x8, turn grayscale and check if pixels are above or below mean value.
This hash is quite immune against resizing, compression artifacts and hue changes.
You can use Text.LevenshteinDistance or Text.JaroWinklerDistance to compare two hashes.
While GMImage.Hash does make a finger print, you can use Hash.Digest to get a hash of the image bytes.
Examples
Play with hash function:
Set Variable [ $ImageRef ; Value: MBS("GMImage.NewFromContainer"; Test::BigImage) ]
Set Variable [ $Hash1 ; Value: MBS("GMImage.Hash"; $ImageRef) ]
Set Variable [ $r ; Value: MBS( "GMImage.Flip"; $ImageRef ) ]
Set Variable [ $Hash2 ; Value: MBS("GMImage.Hash"; $ImageRef) ]
Set Variable [ $r ; Value: MBS( "GMImage.Flop"; $ImageRef ) ]
Set Variable [ $Hash3 ; Value: MBS("GMImage.Hash"; $ImageRef) ]
Set Variable [ $Error ; Value: MBS("GMImage.Release"; $ImageRef) ]
Show Custom Dialog [ "Hash original: " & $hash1 & ¶ & "Hash after 1x mirror: " & $hash2 & ¶ & "Hash after 2x mirror: " &… ]
See also
- GMImage.Erase
- GMImage.Flop
- GMImage.Map
- GMImage.NewFromContainer
- GMImage.Raise
- GMImage.Release
- GMImage.Wave
- Hash.Digest
- Text.JaroWinklerDistance
- Text.LevenshteinDistance
Release notes
- Version 12.4
- Added size parameter for GMImage.Hash function.
- Version 9.4
- Added GMImage.Hash function.
Blog Entries
- Neues MBS Plugin 12.4 für Claris FileMaker
- MBS Plugin 12.4 for Claris FileMaker
- MBS FileMaker Plugin, version 12.4pr1
- Neue Funktionen des MBS FileMaker Plugin 9.4
- MBS FileMaker Plugin 9.4 - More than 5900 Functions In One Plugin
- MBS FileMaker Plugin, version 9.4pr7
This function checks for a license.
Created 10th September 2019, last changed 28th July 2022
