PHP code example of dustindoiron / photodna-client
1. Go to this page and download the library: Download dustindoiron/photodna-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dustindoiron / photodna-client example snippets
$configuration = new PhotoDNA\Configuration(
apiKey: 'apiKey',
endpoint: 'https://api.microsoftmoderator.com/photodna/v1.0/', // default
ncmecUsername: 'ncmecUsername',
ncmecPassword: 'ncmecPassword'
);
$client = new PhotoDNA\Client($configuration);
$imageFile = new PhotoDNA\Resource\ImageFile('/path/to/location');
$imageUrl = new PhotoDNA\Resource\ImageLocation('https://url.com/file.png');
$result = $client->match($imageFile);
// or
$result = $client->match($imageLocation);
// enhanced matching
$result = $client->match($imageFile, true);