### ImageMagick version

7.1.1 Q8

### Operating system

Windows

### Operating system, version and so on

Windows 10/11

### Description

In a memory-intensive scenario on Windows 10/11, when attempting to write a large TIFF image to a blob, a Magick::ErrorCoder is thrown with the error message:

ConsoleApplication4.exe: Write error at scanline 5792. `TIFFAppendToStrip' @ error/tiff.c/TIFFErrors/598
This issue makes it difficult to determine if it's a memory-related problem or something else.
![MicrosoftTeams-image](https://github.com/ImageMagick/ImageMagick/assets/67478505/36edc15a-4532-464d-aa3f-5e315ab2f4de)
Expected Behavior:
The image should be written to the Magick::Blob without any issues, and in the event of an error, a clearer message detailing the exact problem would be beneficial.

Actual Behavior:
The program throws a Magick::ErrorCoder with the error message:
ConsoleApplication4.exe: Write error at scanline 5792. `TIFFAppendToStrip' @ error/tiff.c/TIFFErrors/598


### Steps to Reproduce

Steps to Reproduce:

Consume a significant amount of system memory. In our standalone program, we allocated 1 GB on the heap.
Read an image (in our case bliss.jpg).
Resize the image to larger dimensions (8192x6144).
Change the image's format to TIFF. This does not occur for other image types.
Attempt to write the image to a Magick::Blob.

```
#include <Magick++.h>
#include <iostream>

int main()
{
   try {
      Magick::InitializeMagick(nullptr);
      char* heap = new char[1000 * 1024 * 1024]; // consume some memory
      Magick::Image image("bliss.jpg");
      image.resize("8192x6144");
      image.magick("TIFF");
      Magick::Blob blob;
      image.write(&blob);
      delete[] heap;
      return 0;
   }
   catch (const Magick::ErrorCoder& e) {
      std::cerr << e.what() << std::endl;
      return 1;
   }
}
```


### Images

_No response_
Write Error on Large TIFF Blob in Memory-Intensive Programs
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Write Error on Large TIFF Blob in Memory-Intensive Programs
Issue date:

--- start body ---
### ImageMagick version

7.1.1 Q8

### Operating system

Windows

### Operating system, version and so on

Windows 10/11

### Description

In a memory-intensive scenario on Windows 10/11, when attempting to write a large TIFF image to a blob, a Magick::ErrorCoder is thrown with the error message:

ConsoleApplication4.exe: Write error at scanline 5792. `TIFFAppendToStrip' @ error/tiff.c/TIFFErrors/598
This issue makes it difficult to determine if it's a memory-related problem or something else.
![MicrosoftTeams-image](https://github.com/ImageMagick/ImageMagick/assets/67478505/36edc15a-4532-464d-aa3f-5e315ab2f4de)
Expected Behavior:
The image should be written to the Magick::Blob without any issues, and in the event of an error, a clearer message detailing the exact problem would be beneficial.

Actual Behavior:
The program throws a Magick::ErrorCoder with the error message:
ConsoleApplication4.exe: Write error at scanline 5792. `TIFFAppendToStrip' @ error/tiff.c/TIFFErrors/598


### Steps to Reproduce

Steps to Reproduce:

Consume a significant amount of system memory. In our standalone program, we allocated 1 GB on the heap.
Read an image (in our case bliss.jpg).
Resize the image to larger dimensions (8192x6144).
Change the image's format to TIFF. This does not occur for other image types.
Attempt to write the image to a Magick::Blob.

```
#include <Magick++.h>
#include <iostream>

int main()
{
   try {
      Magick::InitializeMagick(nullptr);
      char* heap = new char[1000 * 1024 * 1024]; // consume some memory
      Magick::Image image("bliss.jpg");
      image.resize("8192x6144");
      image.magick("TIFF");
      Magick::Blob blob;
      image.write(&blob);
      delete[] heap;
      return 0;
   }
   catch (const Magick::ErrorCoder& e) {
      std::cerr << e.what() << std::endl;
      return 1;
   }
}
```


### Images

_No response_
--- end body ---
