jimp-dev / jimp-dev/jimp

Maximum and minimum file size supported

Open
#1,081 1 comment 1 reaction 0 assignees View on GitHub
documentation file size issue help wanted
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

With Jimp, I resize images on my local computer and on a live application. When I try to resize images with high dimensions (40k*40k or 100mb), I encounter a few errors. When calculating the total size, 2 different values are taken as a basis. These are the _maxMemoryUsageInMB_ and _maxResolutionInMP_ values. Exceeding any of these values returns an error code:::

###### maxMemoryUsageInMB::
![maxMemory](https://user-images.githubusercontent.com/11391017/161900481-355f0e15-845a-4759-9d51-9918d46e1fc3.png)

##### maxResolutionInMP::
![maxResolution](https://user-images.githubusercontent.com/11391017/161900572-2db192d2-88fe-46c4-a858-92beb5a5758e.png)

And sometimes when getting some of these errors I can see it coming due to the amount of RAM being exceeded. I guess this is happening because of NodeJS runtime.

![nodeJSENV](https://user-images.githubusercontent.com/11391017/161900794-9c2e6ff6-ff82-499d-8336-e30f69104a76.png)

I have a few questions.
1. Up to what dimensions can I resize an image?
2. What dimensions should the pixel pitches (10px*10px -- 35000px*35000px) of an image I want to resize be?

To test this situation, try to reconstruct a 1800x1800 pixel image with 36000*36000 dimensions. In such a scenario it will return error codes.

```import Jimp from 'jimp';

Jimp.read('./images/xxxxx.png', (err, image) => {
if (err) throw err;
image
.resize(35000, 35000)
.write('./images/dune-resize.png'); // save
});```

- Jimp Version: 0.16.1
- Node version: v17.4.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.