Hi there,
I would have expected this code:
$client = new Client();
$client->emojiSize = 64;
echo $client->toImage('馃榾');
To produce <img class="joypixels" alt="馃榾" title=":grinning:" src="https://cdn.jsdelivr.net/joypixels/assets/7.0/png/unicode/64/1f600.png">, since the code is documented to say we can set emojiSize: "available sizes are '32', '64', and '128'", but instead it produced <img class="joypixels" alt="馃榾" title=":grinning:" src="https://cdn.jsdelivr.net/joypixels/assets/7.0/png/unicode/32/1f600.png">,.
|
public $emojiSize = '32'; // available sizes are '32', '64', and '128' |
The issue is that since the imagePathPNG property is set in the constructor, it is too late use the emojiSize property on the $client instance.
|
$this->imagePathPNG = $this->imagePathPNG . '/' . $this->emojiVersion . '/png/unicode/' . $this->emojiSize . '/'; |
A workaround is this, but I believe the code should act different, since it's not possible to customize it by setting the public property:
$client = new class extends Client {
public $emojiSize = '64';
};
echo $client->toImage('馃榾');
Hi there,
I would have expected this code:
To produce
<img class="joypixels" alt="馃榾" title=":grinning:" src="https://cdn.jsdelivr.net/joypixels/assets/7.0/png/unicode/64/1f600.png">, since the code is documented to say we can setemojiSize:"available sizes are '32', '64', and '128'", but instead it produced<img class="joypixels" alt="馃榾" title=":grinning:" src="https://cdn.jsdelivr.net/joypixels/assets/7.0/png/unicode/32/1f600.png">,.emoji-toolkit/lib/php/src/Client.php
Line 16 in 7ed2733
The issue is that since the
imagePathPNGproperty is set in the constructor, it is too late use theemojiSizeproperty on the$clientinstance.emoji-toolkit/lib/php/src/Client.php
Line 36 in 7ed2733
A workaround is this, but I believe the code should act different, since it's not possible to customize it by setting the public property: