Open mashirou1234 opened 5 years ago
HI @mashirou1234,
Could you please upload the picture that causes this crash, if it isn't confidential ?
Hi @Lucassifoni
A crashed image and a set of images. The same phenomenon occurs even when renaming is performed.
Thank you in advance.
Does this one trigger the same problem ?
Sorry, it's late. I checked the received image data and it was an error.
Hi @mashirou1234 I tried hashing it with a minimal setup :
{
"name": "test/imagehash",
"type": "project",
"require": {
"jenssegers/imagehash": "^0.6.0"
},
}
<?php
require __DIR__ . '/vendor/autoload.php';
use Jenssegers\ImageHash\ImageHash;
use Jenssegers\ImageHash\Implementations\DifferenceHash;
$hasher = new ImageHash(new DifferenceHash());
echo $hasher->hash("80.jpg");
lucas@funghi ~/B/imagehash> php script.php
733939321849317a
The image itself doesn't seem to trigger a bug. Can you try this minimal setup too ? If it still doesn't work, we'll see with your php install.
Thanks
Hello, I would just like to add to this that I had the same problem with the exact same error in Decoder.php.
I knew it wasn't the image because the wierd thing was it was working in one project and not the other. I managed to solve it by fixing the GD install for PHP from:
RUN docker-php-ext-configure gd \
To:
RUN docker-php-ext-configure gd --with-jpeg --with-webp \
We're obviously using a docker system here. But that was the issue and now hashing works again.
Hi. I am developing on Laravel 5.5 project using laradock.
When outputting image file names sequentially, an error is output for a specific image. The content of the error is "Unable to init from given binary data." But, hashing a specific image will cause an error.
In this way, if the prefix is ​​"80" an error will be output. This phenomenon occurs when outputting images in sequential order.
At present, it is solved by attaching "image_" to the prefix, but I think that it is not the root solution.
If you look at the contents of the error, It is an error in "/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php"
Decoder.php Error Message
It is an error of the library used by imagehash, so it may not be the contents to ask here. Please pardon.
Laravel Error Message
use source
My development environment supported jpeg on GD