Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fatal error: Uncaught TypeError: Unsupported operand types: array & int in C:\xampp8\htdocs\Mind_Realm_Web_Builder\php\bsave support.php:53 Stack trace: #0 C:\xampp8\htdocs\Mind_Realm_Web_Builder\php\super bsave.php(38): load_bsave('C:/xampp8/htdoc...') #1 C:\xampp8\htdocs\Mind_Realm_Web_Builder\mk11SUPER.php(6): super_bsave() #2 {main} thrown in C:\xampp8\htdocs\Mind_Realm_Web_Builder\php\bsave support.php on line 53
- ===
- <?php
- function cvshort( $subject = '' )
- {
- return unpack("S", $subject);
- }
- function load_bsave( $filename = '' )
- {
- $z = intval(0);
- $w = intval(0);
- $h = intval(0);
- $x = intval(0);
- $y = intval(0);
- $b = intval(0);
- $cb = intval(0);
- //dim as integer filemode = freefile
- $header = '';
- $buffer = '';
- $ret = '';
- if( !is_file( $filename ) )
- {
- $image = imagecreate( 24, 24);
- for( $offset = 0; $offset <= 5; $offset++ )
- {
- switch( $offset & 1 )
- {
- case 0:
- imageline( $image, 5-$offset, 0, 23-$offset, 23,12 ); // ,,&HAAAA
- case 1:
- imageline( $image, 23-$offset, 0, 5-$offset, 23,12 ); // ,,&HAAAA
- }
- }
- return $image;
- }
- $buffer = file_get_contents( $filename );
- $header = substr( $buffer, 0, 11 );
- $buffer = substr( $buffer, strlen( $header ) + 1 );
- $magic = substr( $header, 0, 1 );
- if( ord( $magic ) !== 0xFD )
- {
- return false;
- }
- $z = cvshort( substr( $header, 5 , 2 ) ) & 32767;
- $w = cvshort( substr( $header, 7 , 2 ) ) & 32767;
- $h = cvshort( substr( $header, 9 , 2 ) ) & 32767;
- if( ( $w === 25 ) && ( $h === 25 ) )
- {
- $image = imagecreate( 24, 24 );
- }
- else
- {
- $image = imagecreate( $w, $h );
- }
- for( $y = 0; $y < $h; $y++ )
- {
- for( $b = 0; $b < 4; $b++ )
- {
- for( $x = 0; $x < $w; $x++ )
- {
- if( ($x & 7) === 0 )
- {
- $cb = ord( substr( $buffer, 0, 1 ) );
- $buffer = substr( $buffer, 1 );
- }
- imagesetpixel( $image, $x, $y, imagecolorat( $image, $x, $y ) ^ ( ( 1 << $b ) & intdiv( -$cb, 0x80 ) ) );
- $cb += $cb & 0xFF;
- }
- }
- }
- return $image;
- }
- ?>
Add Comment
Please, Sign In to add comment