Skip to content

imagecopyresampled(): supplied resource is not a valid Image resource #689

Description

@JakeAi

I have tried multiple code setups for the image class and I cannot get it working, the way I need it to. I can do one file at a time. If I want to create thumbnails it errors. These are the setups I've tried. I have been digging through the class trying to find where it goes wrong, but I can't find it anywhere.

foreach ($this->sizes as $size) {
	$copyImage = \Config\Services::image( 'gd' )
			->withFile( "{$folderPath}/{$filename}.{$extension}" )
			->resize( $size, $size )
			->save( "{$folderPath}/{$filename}x{$size}.{$extension}" );
}
$copyImage = \Config\Services::image( 'gd' );
foreach ($this->sizes as $size) {
	$copyImage->withFile( "{$folderPath}/{$filename}.{$extension}" )
			->resize( $size, $size )
			->save( "{$folderPath}/{$filename}x{$size}.{$extension}" );
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions