public static function getQrCodeSrc($data, $size = '200x200', $logo = false)
  {
    if (empty($data)) {
      return '';
    }

    // Parse size input
    list($width, $height) = explode('x', strtolower($size));
    $targetSize = max((int) $width, (int) $height);

    $options = new QROptions([
      'version' => Version::AUTO,
      'outputType' => QROutputInterface::GDIMAGE_PNG,
      'eccLevel' => EccLevel::H,
      'scale' => max(1, (int) ($targetSize / 33)),
      'imageBase64' => false,
      'addQuietzone' => false,
      'addLogoSpace' => !empty($logo),
      'logoSpaceWidth' => 0,
      'logoSpaceHeight' => 0,
    ]);

    try {
      // Generate the QR code
      $qrcode = (new QRCode($options))->render($data);

      // Create base image
      $padding = 5;
      $borderWidth = 3;
      $radius = 10;
      $totalPadding = $padding * 2 + $borderWidth * 2;
      $baseImage = imagecreatetruecolor($targetSize, $targetSize);

      // Create colors
      $white = imagecolorallocate($baseImage, 255, 255, 255);
      $black = imagecolorallocate($baseImage, 0, 0, 0);

      // Enable alpha blending
      imagealphablending($baseImage, true);

      // Fill background with white
      imagefill($baseImage, 0, 0, $white);

      // Helper function to draw rounded rectangle with smooth corners
      $drawRoundedRectangle = function ($image, $x1, $y1, $x2, $y2, $radius, $color) {
        // Draw main horizontal and vertical rectangles
        imagefilledrectangle($image, $x1 + $radius, $y1, $x2 - $radius, $y2, $color); // Horizontal
        imagefilledrectangle($image, $x1, $y1 + $radius, $x2, $y2 - $radius, $color); // Vertical

        // Draw the four corners
        imagefilledarc($image, $x1 + $radius, $y1 + $radius, $radius * 2, $radius * 2, 180, 270, $color, IMG_ARC_PIE);
        imagefilledarc($image, $x2 - $radius, $y1 + $radius, $radius * 2, $radius * 2, 270, 360, $color, IMG_ARC_PIE);
        imagefilledarc($image, $x1 + $radius, $y2 - $radius, $radius * 2, $radius * 2, 90, 180, $color, IMG_ARC_PIE);
        imagefilledarc($image, $x2 - $radius, $y2 - $radius, $radius * 2, $radius * 2, 0, 90, $color, IMG_ARC_PIE);
      };

      // Draw outer black border
      $drawRoundedRectangle($baseImage, 0, 0, $targetSize - 1, $targetSize - 1, $radius, $black);

      // Draw inner white area
      $drawRoundedRectangle($baseImage, $borderWidth, $borderWidth, $targetSize - 1 - $borderWidth, $targetSize - 1 - $borderWidth, $radius - $borderWidth, $white);

      // Process QR code
      $qrImage = imagecreatefromstring($qrcode);

      // Calculate QR code size to fit within padding
      $qrSize = $targetSize - $totalPadding;

      // Resize and place QR code
      imagecopyresampled($baseImage, $qrImage, $borderWidth + $padding, $borderWidth + $padding, 0, 0, $qrSize, $qrSize, imagesx($qrImage), imagesy($qrImage));

      // If logo is provided
      if ($logo) {
        $logoContent = file_get_contents($logo);
        if ($logoContent === false) {
          throw new \Exception('Failed to read logo file');
        }

        $logoImage = imagecreatefromstring($logoContent);
        if (!$logoImage) {
          throw new \Exception('Invalid logo image format');
        }

        // Calculate logo size (35% of QR code size)
        $logoNewWidth = (int) ($qrSize * 0.35);
        $logoNewHeight = (int) (imagesy($logoImage) * ($logoNewWidth / imagesx($logoImage)));

        // Center logo on QR code
        $logoX = (int) ($borderWidth + $padding + ($qrSize - $logoNewWidth) / 2);
        $logoY = (int) ($borderWidth + $padding + ($qrSize - $logoNewHeight) / 2);

        imagecopyresampled($baseImage, $logoImage, $logoX, $logoY, 0, 0, $logoNewWidth, $logoNewHeight, imagesx($logoImage), imagesy($logoImage));

        imagedestroy($logoImage);
      }

      // Clean up
      imagedestroy($qrImage);

      // Output final image
      ob_start();
      imagepng($baseImage);
      $finalImage = ob_get_clean();
      imagedestroy($baseImage);

      return 'data:image/png;base64,' . base64_encode($finalImage);
    } catch (\Exception $e) {
      error_log('QR code generation failed: ' . $e->getMessage());
      return '';
    }
  }

I'm using chillerlan\QRCode library to create qr code, and it works fine, but the corners are not smoothly rounded and black border is disrupted. Can you please properly and simply make the corners of the border rounded by 10px?