[BUG] Immich can't handle images with more than 268 megapixels #1313

Closed
opened 2026-02-05 01:14:26 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @etnoy on GitHub (Sep 7, 2023).

The bug

The sharp library by default limits the resolution to 268 megapixels: https://sharp.pixelplumbing.com/api-constructor (see the limitInputPixels option).

I tried importing an image with 366 megapixels and ran into the following:

immich-microservices_1 | [Nest] 31 - 09/07/2023, 10:41:07 PM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): Error: Input image exceeds pixel limit

The result is rather unusual, the image shows up in immich but can't be metadata-extracted and no thumbnail is generated.

image

This is an image scanned on a flatbed scanner with high resolution.

I suggest we increase the limit somewhat. Setting limitInputPixels in sharp should allow for either unlimited (which feels bad) or a higher (1000 megapixels?) limit.

The OS that Immich Server is running on

N/A

Version of Immich Server

v1.77.0

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

Upload an image of decent resoultion

Additional information

No response

Originally created by @etnoy on GitHub (Sep 7, 2023). ### The bug The sharp library by default limits the resolution to 268 megapixels: https://sharp.pixelplumbing.com/api-constructor (see the limitInputPixels option). I tried importing an image with 366 megapixels and ran into the following: `immich-microservices_1 | [Nest] 31 - 09/07/2023, 10:41:07 PM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): Error: Input image exceeds pixel limit` The result is rather unusual, the image shows up in immich but can't be metadata-extracted and no thumbnail is generated. ![image](https://github.com/immich-app/immich/assets/135728/fb2a7d05-d204-47fe-a7fd-ae518392f0cc) This is an image scanned on a flatbed scanner with high resolution. I suggest we increase the limit somewhat. Setting limitInputPixels in sharp should allow for either unlimited (which feels bad) or a higher (1000 megapixels?) limit. ### The OS that Immich Server is running on N/A ### Version of Immich Server v1.77.0 ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash Upload an image of decent resoultion ``` ### Additional information _No response_
OVERLORD added the external-library label 2026-02-05 01:14:26 +03:00
Author
Owner

@etnoy commented on GitHub (Sep 8, 2023):

I've solved the immediate problem for now by reducing the resolution of the images I'm importing to Immich. For libraries, though, we need some way of handling this issue more gracefully

@etnoy commented on GitHub (Sep 8, 2023): I've solved the immediate problem for now by reducing the resolution of the images I'm importing to Immich. For libraries, though, we need some way of handling this issue more gracefully
Author
Owner

@aviv926 commented on GitHub (Jan 11, 2024):

I get the same error.

image info:
image

To be honest, this is an image that was uploaded from an external library and I forgot that I had enlarged it with AI, it's really an unusual pixel size, but I guess it also happens with fewer pixels than that (?)

@aviv926 commented on GitHub (Jan 11, 2024): I get the same error. image info: ![image](https://github.com/immich-app/immich/assets/51673860/12f503e4-1660-4102-bb98-84974e0bcc4a) To be honest, this is an image that was uploaded from an external library and I forgot that I had enlarged it with AI, it's really an unusual pixel size, but I guess it also happens with fewer pixels than that (?)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1313