image icon indicating copy to clipboard operation
image copied to clipboard

Backup() & Reset() not working

Open rajjanorkar opened this issue 4 years ago • 11 comments

/ create an image
$img = Image::make('public/foo.jpg');

// backup status
$img->backup();

// reset image (return to backup state)
$img->reset();

throwing an error, i am using version 2.5.1

{message: "Backup not available. Call backup() before reset().",…}
exception: "Intervention\Image\Exception\RuntimeException"
file: "/Users/rajdeepjanorkar/Data/Websites/flymetoyou.com/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php"
line: 34
message: "Backup not available. Call backup() before reset()."

rajjanorkar avatar Apr 21 '21 09:04 rajjanorkar

confirmed

It doesn't work

nitrogenium avatar May 02 '21 15:05 nitrogenium

See: https://php.watch/versions/8.0/gdimage

Quote: “Note that all functions in GD extension now returns and expects \GdImage objects instead of resource objects.”

nitrogenium avatar May 02 '21 16:05 nitrogenium

I fixed this error by creating a fork with the following modification and including it in the composer.json:

https://github.com/asdrubalini/image/commit/5823ff01800040f27b6d6447d16e7038e24ac5e6#diff-66957f6a0c650c264ed2a332993a21b2f6a0ba0bf8cb64ec4a279d2a88aeef3f

asdrubalini avatar May 11 '21 06:05 asdrubalini

Thanks @asdrubalini. I hope this gets picked up soon.

FullWebService avatar Jul 31 '21 13:07 FullWebService

will this be fixed?

neylsongularte avatar Aug 06 '21 21:08 neylsongularte

Hello. Any update on this??

rumeau avatar Aug 27 '21 05:08 rumeau

I fixed this error by creating a fork with the following modification and including it in the composer.json:

asdrubalini@5823ff0#diff-66957f6a0c650c264ed2a332993a21b2f6a0ba0bf8cb64ec4a279d2a88aeef3f

Please submit as PR

rumeau avatar Aug 27 '21 05:08 rumeau

Just noticed this is already fixed on master. But hasn't been tagged

rumeau avatar Aug 27 '21 05:08 rumeau

I still have this issue.

I'm using Intervention/Image version 2.6.1 and PHP 8.0.10

Ashraam avatar Sep 17 '21 08:09 Ashraam

I too still have this issue.

AlexDanault avatar Sep 29 '21 17:09 AlexDanault

Also having this issue

williamxsp avatar Oct 27 '21 12:10 williamxsp

This issue refers to version 2. I would like to point out that there is now a new major version. The backup() method no longer exists and is handled differently.

See: https://github.com/Intervention/image/issues/1274#issuecomment-1898019101

olivervogel avatar Jan 27 '24 17:01 olivervogel