removeMotion
The still photo of a Motion Photo: every byte up to the video, with the XMP that named the video rewritten to say there is none: GCamera:MotionPhoto 0, the video's directory item and the MicroVideo fields removed. A gain map item and its bytes stay. A Samsung file is cut at the end of its JPEG, with its trailer. A HEIC or AVIF file loses its mpvd box and keeps its XMP, as Motion Photo 1.0 allows. A file with no video comes back as a copy, and the photo decodes to the same pixels (#131, #155).
Throws
for a HEIF file whose mpvd box other boxes follow, since removing it would move their data