Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for resize contradict each other #1354

Open
simonh1000 opened this issue Oct 24, 2024 · 1 comment
Open

Docs for resize contradict each other #1354

simonh1000 opened this issue Oct 24, 2024 · 1 comment

Comments

@simonh1000
Copy link

Expected Behavior

I followed the instructions on https://jimp-dev.github.io/jimp/guides/getting-started/ and expect to get an image of width 100px

Current Behavior

I get a huge crash

Failure Information (for bugs)

Steps to Reproduce

import { Jimp } from "jimp";

const name = "IMG_6637.JPG";

const image = await Jimp.read(`event/${name}`);
console.log({ width: image.width, height: image.height });
image.resize({ width: 100 });
await image.write("test/output.png");

but with

image.resize({ width: 100 });

which I found at https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#resize then it does work

Screenshots

Context

  • Jimp Version: 1.6
  • Operating System: OSX Sequioa
  • Node version: 18.18

Failure Logs

@RogerBambinetti
Copy link

Hey,

The resize function should receive an object following the "ResizeOptionsSchema" instead.

I've created a pull request to fix the docs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants