### ImageMagick version

7.1.0-62 - 7.1.1-27

### Operating system

Linux

### Operating system, version and so on

Ubuntu 20.04 and others

### Description

This is a new manifestation of, and caused by, changes in #6052.
The issue observed is the same, it is simply caused by slightly different EXIF metadata.

With input images with particular EXIF data, saving to MIFF corrupts the image data.
This is a regression introduced between versions 7.1.0-61 and 7.1.0-62 as part of issue #6052. This also relates to changes made as part of issue #4987.


### Steps to Reproduce

```
magick logo_with_metadata.jpg MIFF:- | magick MIFF:- broken.jpg
```

### Images

logo_with_metadata.jpg:
![logo_with_metadata](https://github.com/ImageMagick/ImageMagick/assets/316852/da8c375c-83e0-47ec-85e6-2432fd167dc2)

broken.jpg:
![broken](https://github.com/ImageMagick/ImageMagick/assets/316852/eef15c50-35b1-4ece-957a-5261e87583db)

Image corruption when writing to MIFF from an input image with particular EXIF (Part 2)
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Image corruption when writing to MIFF from an input image with particular EXIF (Part 2)
Issue date:

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

7.1.0-62 - 7.1.1-27

### Operating system

Linux

### Operating system, version and so on

Ubuntu 20.04 and others

### Description

This is a new manifestation of, and caused by, changes in #6052.
The issue observed is the same, it is simply caused by slightly different EXIF metadata.

With input images with particular EXIF data, saving to MIFF corrupts the image data.
This is a regression introduced between versions 7.1.0-61 and 7.1.0-62 as part of issue #6052. This also relates to changes made as part of issue #4987.


### Steps to Reproduce

```
magick logo_with_metadata.jpg MIFF:- | magick MIFF:- broken.jpg
```

### Images

logo_with_metadata.jpg:
![logo_with_metadata](https://github.com/ImageMagick/ImageMagick/assets/316852/da8c375c-83e0-47ec-85e6-2432fd167dc2)

broken.jpg:
![broken](https://github.com/ImageMagick/ImageMagick/assets/316852/eef15c50-35b1-4ece-957a-5261e87583db)

--- end body ---
