@nextcloud/image-editor
    Preparing search index...

    Function setJpegOrientation

    • The same JPEG, recorded as being oriented some other way.

      Only the tag is touched. The scan is copied across byte for byte, so the picture is not decoded, not re-encoded, and loses nothing: turning an image this way costs the same whether it is done once or a hundred times. Where the file already names an orientation this is a two-byte write and the file does not even change length.

      Parameters

      • bytes: Uint8Array

        the file to amend

      • orientation: Orientation

        the value to record

      Returns Uint8Array<ArrayBuffer> | null

      the amended file, backed by its own buffer so it can be handed straight to a Blob, or null where it could not be written