Closed light8771 closed 1 month ago
I had no problem after fixing the Providers problem here #306
If you still had a problem can you shared more detailed.
same
Okay, can you share more details so I can replicated and try fix it.
On Fri, Aug 23, 2024, 11:37 PM ariadys @.***> wrote:
same
— Reply to this email directly, view it on GitHub https://github.com/mewebstudio/captcha/issues/305#issuecomment-2307432661, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGJCHR4KAWYFPO2N2SHTIOTZS5QL7AVCNFSM6AAAAABMOINYB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGQZTENRWGE . You are receiving this because you commented.Message ID: @.***>
PHP 8.3.10 Laravel 11.20.0 mews/captcha 3.4.2 intervention/image 3.8.0
Hi, due to the changes in version 3.8.0 of intervention/image, the new ability to read instances of EncodedImage::class with ImageManager::class has been introduced. However, the Intervention\Image\EncodedImage class no longer has the encode property.
<?php
declare(strict_types=1);
namespace Intervention\Image;
use Intervention\Image\Interfaces\EncodedImageInterface;
class EncodedImage extends File implements EncodedImageInterface
{
/**
* Create new instance
*
* @param string $data
* @param string $mediaType
*/
public function __construct(
protected string $data,
protected string $mediaType = 'application/octet-stream'
) {
}
/**
* {@inheritdoc}
*
* @see EncodedImageInterface::mediaType()
*/
public function mediaType(): string
{
return $this->mediaType;
}
/**
* {@inheritdoc}
*
* @see EncodedImageInterface::mimetype()
*/
public function mimetype(): string
{
return $this->mediaType();
}
/**
* {@inheritdoc}
*
* @see EncodedImageInterface::toDataUri()
*/
public function toDataUri(): string
{
return sprintf('data:%s;base64,%s', $this->mediaType, base64_encode($this->data));
}
}
@ithsjeff Hi, I updated to 3.4.2
and the problem is not solved
PHP 8.3.10 Laravel 11.20.0 mews/captcha 3.4.2 intervention/image 3.8.0
Hi, due to the changes in version 3.8.0 of intervention/image, the new ability to read instances of EncodedImage::class with ImageManager::class has been introduced. However, the Intervention\Image\EncodedImage class no longer has the encode property.
<?php declare(strict_types=1); namespace Intervention\Image; use Intervention\Image\Interfaces\EncodedImageInterface; class EncodedImage extends File implements EncodedImageInterface { /** * Create new instance * * @param string $data * @param string $mediaType */ public function __construct( protected string $data, protected string $mediaType = 'application/octet-stream' ) { } /** * {@inheritdoc} * * @see EncodedImageInterface::mediaType() */ public function mediaType(): string { return $this->mediaType; } /** * {@inheritdoc} * * @see EncodedImageInterface::mimetype() */ public function mimetype(): string { return $this->mediaType(); } /** * {@inheritdoc} * * @see EncodedImageInterface::toDataUri() */ public function toDataUri(): string { return sprintf('data:%s;base64,%s', $this->mediaType, base64_encode($this->data)); } }
we are facing same issue, after changing encoded to toDataURI() it works for us too.
@light8771 @felixmertins Okay, Waiting to this PR #309 to be merged.
8.1.13
10.48.20
3.4.1
3.7.2
domain/captcha/api
Access errorI need to change the error line to
'img' => $this->image->encode()->toDataUri()
to run normally