Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/docs/src/content/docs/guides/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,22 @@ The workflow for using jimp
```

</Steps>

## EXIF orientation

When loading JPEGs, Jimp reads EXIF metadata and automatically rotates the
bitmap according to the EXIF `Orientation` tag. After rotation, the image is
treated as normal orientation:

```ts
import { getExifOrientation } from "@jimp/core";
import { Jimp } from "jimp";

const image = await Jimp.read("photo.jpg");

console.log(getExifOrientation(image)); // 1 after auto-rotation
```

Jimp uses EXIF metadata for orientation correction when reading an image. It
does not provide a public API for editing, adding, copying, or preserving
arbitrary EXIF tags when writing images.
10 changes: 10 additions & 0 deletions packages/jimp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ image.resize(256, 256); // resize

await image.write("test-small.jpg"); // save
```

## EXIF orientation

Jimp automatically applies EXIF orientation when reading JPEG images. You can
inspect the normalized orientation with `getExifOrientation(image)` from
`@jimp/core`, which returns `1` after auto-rotation.

Jimp uses EXIF metadata for orientation correction only. It does not expose a
public API for editing, adding, copying, or preserving arbitrary EXIF tags when
writing images.