Comments (8)
Looks like an issue with your php installation.
from imagehash.
Ok, a workaround resolved.. Now the problem is about use
clause position and path, at my projetc/src
folder where I run composer require jenssegers/imagehash
now I have as ls
:
composer.json composer.lock sync.php
vendor
autoload.php
composer
jenssegers
imagehash
composer.json README.md
src
ImageHash.php Implementation.php Implementations
Them, at my projects folder I run php sync.php
... ERROR
PHP Fatal error: Uncaught Error: Class 'Jenssegers\ImageHash\ImageHash' not found
from imagehash.
Ok, fixed the problem with require __DIR__ . '/vendor/autoload.php'
... So the real problem/suggestion is:
if you see as support, I can add or suggest text for "A Dummy's Guide To Install and use imagehash"
from imagehash.
That's not really a problem related to this package. When using a package with composer you are assumed to know at least how to include the composer autoloader.
from imagehash.
require __DIR__ . '/vendor/autoload.php';
$hasher = new ImageHash;
$hash = $hasher->hash('img/img1.jpg');
$hash2 = $hasher->hash('img/img2.jpg');
$distance = $hasher->distance($hash1, $hash2);
echo $distance;
this is my code but still iam getting this error
Fatal error: Uncaught Error: Class 'ImageHash' not found
from imagehash.
@sppidy Did you install the package?
composer require jenssegers/imagehash
from imagehash.
@wouterds yes i installed it
from imagehash.
@sppidy you still need to add a use statement due to namespaces. Add the following code after your require statement.
use ImageHash;
So it will look like this:
require __DIR__ . '/vendor/autoload.php';
use ImageHash;
$hasher = new ImageHash;
Also, most modern IDE's will alert you to this need and offer auto-fill capabilities. I suggest PHPStorm.
from imagehash.
Related Issues (20)
- MySQL DB data type field to store hash for comparision? HOT 1
- Differences using ImageHash Class and MySQL DB comparision HOT 3
- q
- Return value of Jenssegers\ImageHash\Hash::toInt() must be of the type int, float returned HOT 14
- ImageHash does not work on remote directories in macOS Catalina HOT 1
- Crop solid background colours (e.g. black or white borders) HOT 2
- BlockHash HOT 3
- Library does not support php 8.0.1 HOT 3
- 对于相同的图片产生了不同的结果
- BUG : Uncaught Error: Call to a member function toHex() on string HOT 1
- BUG : Uncaught Error: Call to a member function toHex() on string
- phpseclib/phpseclib version issue was reported when composer introduced the package
- Hash size HOT 4
- Archive this repo
- Same result for different images HOT 1
- Hello, MAY I ask, these two pictures, visible to the naked eye, are different, why after comparison, the display is the same? HOT 1
- Undocumented breaking change due to type hints HOT 1
- New maintainers HOT 3
- Hash::fromHex HOT 8
- Support for intervention/image ^3.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagehash.