Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get the size of an image
getimagesize(string $filename, array &$image_info = null): array|false
return true;
}
if (! $this->isValidFileInstance($value) || ! $sizeDetails = @getimagesize($value->getRealPath())) {
return false;
}
}
if (! $this->isValidFileInstance($value) || ! $sizeDetails = @getimagesize($value->getRealPath())) {
return false;
}
$image = (new FileFactory)->image('test.png', 15, 20);
$info = getimagesize($image->getRealPath());
$this->assertSame('image/png', $info['mime']);
$this->assertSame(15, $info[0]);
$info = getimagesize($image->getRealPath());
$this->assertSame('image/png', $info['mime']);
$this->assertSame(15, $info[0]);
$jpeg = (new FileFactory)->image('test.jpeg', 15, 20);
$jpg = (new FileFactory)->image('test.jpg');
$info = getimagesize($jpeg->getRealPath());
$this->assertSame('image/jpeg', $info['mime']);
$this->assertSame(15, $info[0]);
$jpg = (new FileFactory)->image('test.jpg');
$info = getimagesize($jpeg->getRealPath());
$this->assertSame('image/jpeg', $info['mime']);
$this->assertSame(15, $info[0]);
$this->assertSame(
'image/vnd.wap.wbmp',
getimagesize($image->getRealPath())['mime']
);
}
'image/vnd.wap.wbmp',
getimagesize($image->getRealPath())['mime']
);
}
$this->assertSame('image/x-ms-bmp', mime_content_type($imagePath));
$this->assertSame('image/bmp', getimagesize($imagePath)['mime']);
}
public function testCreateWithMimeType()
$this->assertSame('image/bmp', getimagesize($imagePath)['mime']);
}
public function testCreateWithMimeType()
$key = $this->argument(0)->value();
$info = [];
@getimagesize($image->dirname .'/'. $image->basename, $info);
$data = [];
$info = [];
@getimagesize($image->dirname .'/'. $image->basename, $info);
$data = [];
$manager->copy("source://{$this->asset->path()}", $destination);
try {
$size = getimagesize($cache->getAdapter()->getPathPrefix().$cachePath);
} catch (\Exception $e) {
$size = [0, 0];
} finally {
try {
$size = getimagesize($cache->getAdapter()->getPathPrefix().$cachePath);
} catch (\Exception $e) {
$size = [0, 0];
} finally {
if ($this->isResizable($item)) {
$path = $this->generateImage($item);
[$width, $height] = getimagesize($this->getServer()->getCache()->getAdapter()->getPathPrefix().$path);
$data['width'] = $width;
$data['height'] = $height;
$path = $this->generateImage($item);
[$width, $height] = getimagesize($this->getServer()->getCache()->getAdapter()->getPathPrefix().$path);
$data['width'] = $width;
$data['height'] = $height;
$realpath = Storage::disk('test')->getAdapter()->getPathPrefix().'path/to/asset.jpg';
$this->assertFileExists($realpath);
$imagesize = getimagesize($realpath);
$this->assertEquals([30, 60], array_splice($imagesize, 0, 2));
$dimensions = $this->dimensions->asset($asset);
$this->assertFileExists($realpath);
$imagesize = getimagesize($realpath);
$this->assertEquals([30, 60], array_splice($imagesize, 0, 2));
$dimensions = $this->dimensions->asset($asset);