code: def test_issue2088(tmpdir, capsys, driver):
      """Write a PNG or JPEG without error messages"""
      with rasterio.open(
          str(tmpdir.join("test")),
          "w",
          driver=driver,
          dtype="uint8",
          count=1,
          height=256,
          width=256,
          transform=affine.Affine.identity(),
      ) as src:
          data = np.ones((256, 256), dtype=np.uint8)
          src.write(data, 1)
  
      captured = capsys.readouterr()
      assert "ERROR 4" not in captured.err
      assert "ERROR 4" not in captured.out
  
imports: import logging
  import re
  from pathlib import Path
  import subprocess
  import affine
  import numpy
  import pytest
  from .conftest import requires_gdal35, gdal_version
  import rasterio
  from rasterio.drivers import blacklist
  from rasterio.enums import MaskFlags, Resampling
  from rasterio.env import Env, GDALVersion
  from rasterio.errors import RasterioIOError
label_desc: Use image node_id 28 for calling a global function with example usage: test_issue2088(tmpdir, capsys, driver) without return types