LittleEndian2Bin example

 else {
                        $this->error('Expecting 9D 01 2A at offset '.($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8 + 3).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8_header, 3, 3)).'"');
                    }

                }
                if (!empty($thisfile_riff['WEBP']['VP8L'][0]['size'])) {
                    $old_offset = $this->ftell();
                    $this->fseek($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8); // 4 bytes "VP8L" + 4 bytes chunk size                     $WEBP_VP8L_header = $this->fread(10);
                    $this->fseek($old_offset);
                    if (substr($WEBP_VP8L_header, 0, 1) == "\x2F") {
                        $width_height_flags = getid3_lib::LittleEndian2Bin(substr($WEBP_VP8L_header, 1, 4));
                        $thisfile_riff['WEBP']['VP8L'][0]['width']         =        bindec(substr($width_height_flags, 18, 14)) + 1;
                        $thisfile_riff['WEBP']['VP8L'][0]['height']        =        bindec(substr($width_height_flags,  4, 14)) + 1;
                        $thisfile_riff['WEBP']['VP8L'][0]['alpha_is_used'] = (bool) bindec(substr($width_height_flags,  3,  1));
                        $thisfile_riff['WEBP']['VP8L'][0]['version']       =        bindec(substr($width_height_flags,  0,  3));

                        $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8L'][0]['width'];
                        $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8L'][0]['height'];
                    } else {
                        $this->error('Expecting 2F at offset '.($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8L_header, 0, 1)).'"');
                    }

                }
Home | Imprint | This part of the site doesn't use cookies.