Skip to content

Commit

Permalink
whoops
Browse files Browse the repository at this point in the history
whoops
  • Loading branch information
norcross committed Nov 12, 2024
1 parent 565efc2 commit a8a8047
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions airplane-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,20 +502,7 @@ public function replace_gravatar( $avatar, $id_or_email, $size, $default, $alt )
// Swap out the file for a base64 encoded image generated based on the $id_or_email.
$image = $this->generate_color_avatar( $id_or_email );

/*
$hash = md5( strtolower( trim( $id_or_email ) ) );
$im = imagecreatetruecolor( 1, 1 );
$rgb = sscanf( $hash, '%2x%2x%2x' );
$color = imagecolorallocate( $im, $rgb[0], $rgb[1], $rgb[2] );
imagesetpixel( $im, 0, 0, $color );
$mem = fopen( 'php://memory', 'rb+' );
imagepng( $im, $mem );
rewind( $mem );
imagedestroy( $im );
$image = 'data:image/png;base64,' . base64_encode( stream_get_contents( $mem ) );
fclose( $mem );
*/

// Build the image string.
$avatar = "<img alt='{$alt}' src='{$image}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' style='background:#eee;' />";

// Return the avatar.
Expand Down Expand Up @@ -1314,7 +1301,7 @@ public function generate_color_avatar( $id_or_email ) {
$define_user_sr = is_object( $id_or_email ) ? $id_or_email->comment_author_email : $id_or_email;

// Swap out the file for a base64 encoded image generated based on the $id_or_email.
$generate_hash = md5( strtolower( trim( $id_or_email ) ) );
$generate_hash = md5( strtolower( trim( $define_user_sr ) ) );

// Set a color image.
$color_image = imagecreatetruecolor( 1, 1 );
Expand Down

0 comments on commit a8a8047

Please sign in to comment.