Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified images/class_images/lotro_beorning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_burglar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_captain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_champion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_guardian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_hunter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_lore-master.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_minstrel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_rune-keeper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/class_images/lotro_warden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/race_images/lotro_beorning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/race_images/lotro_highelf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/race_images/lotro_monster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/race_images/lotro_stoutaxe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/race_images/lotro_unknown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions tests/game/lotro_icon_dimensions_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
/**
* @package bbGuild LOTRO Extension
* @copyright (c) 2026 avathar.be
* @license GNU General Public License, version 2 (GPL-2.0)
*/

namespace avathar\bbguildlotro\tests\game;

use PHPUnit\Framework\TestCase;

/**
* Guards the icon sets' visual consistency.
*
* The roster renders these files at their natural size with no width or
* height attributes, so a single odd-sized icon misaligns its row. The class icons shipped as a 20/38/43/48 mix and the race icons as a 20/32/48 mix (#3).
*/
class lotro_icon_dimensions_test extends TestCase
{
public function test_class_images_are_all_48x48(): void
{
$this->assertAllSquare('class_images', 48);
}

public function test_race_images_are_all_48x48(): void
{
$this->assertAllSquare('race_images', 48);
}


/**
* @return array<string, array{int, int}> filename => [width, height]
*/
private function dimensions(string $dir): array
{
$path = dirname(__DIR__, 2) . '/images/' . $dir;
$out = array();

foreach (glob($path . '/*.png') as $file)
{
$size = getimagesize($file);
$out[basename($file)] = array($size[0], $size[1]);
}

ksort($out);

return $out;
}

private function assertAllSquare(string $dir, int $expected): void
{
$wrong = array();

foreach ($this->dimensions($dir) as $name => $size)
{
if ($size !== array($expected, $expected))
{
$wrong[$name] = $size[0] . 'x' . $size[1];
}
}

$this->assertSame(
array(),
$wrong,
sprintf('%s icons not %dx%d: %s', $dir, $expected, $expected, json_encode($wrong))
);
}
}
Loading