public static function getImageDpi($filename)
    {
        $a = fopen($filename, 'r');
        $string = fread($a, 20);
        fclose($a);
        $data = bin2hex(mb_substr($string, 14, 4));
        $x = mb_substr($data, 0, 4);
        $y = mb_substr($data, 0, 4);

        return [hexdec($x), hexdec($y)];
    }