Skip to content

PHP Warning at __destruct() #64

@lisotton

Description

@lisotton

I'm using this piece of code:

$img = new SimpleImage($src);

// Resize image;
$img->best_fit($width, $height);

// Save image and output resized image.
$img->save($folder . '/' . $src)->output();

But all time it's log:
PHP Warning: imagedestroy(): 6 is not a valid Image resource in /home/ubuntu/sites/www.noticiasagricolas.com.br/includes/SimpleImage.php on line 57

For now, using is_resource inside of if statement of __destruct function solve the problem, but I think that this is not the best solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions