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

Printed text doesn't Wrap at Max Width #710

Open
johnxy84 opened this issue Mar 10, 2019 · 2 comments
Open

Printed text doesn't Wrap at Max Width #710

johnxy84 opened this issue Mar 10, 2019 · 2 comments
Labels
bug there is a bug in the way jimp behaves help wanted

Comments

@johnxy84
Copy link

johnxy84 commented Mar 10, 2019

Expected Behavior

Text Should Wrap when specified max width is reached

Current Behavior

Text Doesn't Wrap, keeps going

Failure Information (for bugs)

No Erros

Steps to Reproduce

1.Read Image
2. Print Text on Image Specifying Max Width
3. Save Image

        let image = {};
        return Jimp.read('app/background.png')
        .then(imageResponse => {
            // Image is 500 x 500
            image = imageResponse
            return Jimp.loadFont(Jimp.FONT_SANS_64_BLACK);
        })
        .then(font => {
            return image.print(font, margin, margin, 'Very Long Hello WOrld Text', 200)
        })
        .then(image => {
            return image.writeAsync(`app/new-${(new Date()/1000)}.png`);
        })

IF YOUR ISSUE DEPENDS ON A PARTICULAR IMAGE BE SURE TO INCLUDE THIS AS WELL. WE CAN'T REPORDUCE IF WE DON'T HAVE YOUR IMAGE

Screenshots

Context

  • Jimp Version: 0.6.0
  • Operating System: Mac Mojave
  • Node version: 7

Failure Logs

@hipstersmoothie hipstersmoothie added breaking needs a major release bug there is a bug in the way jimp behaves and removed breaking needs a major release labels Apr 27, 2019
@5GameMaker
Copy link

I have a same problem Picture
if (__data.users[uid].lastmsg) pic.print(font, 276, 162, __data.users[uid].lastmsg, 300, (err) => {if (err) throw err});
No errors

@blaues0cke
Copy link

Can confirm that this issue still exist. maxWidth is respected in some way but the breaking will fail depending on the length of the text.

So this is with maxWidth: width- 1536:

3840x2160-174px-test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test__2e918b3e4a84feec9f2d4e98ac984f05

And the same image, rendered with the same code with maxWidth: width - 768:

3840x2160-174px-test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test_test__2e918b3e4a84feec9f2d4e98ac984f05

@hipstersmoothie hipstersmoothie modified the milestone: V1 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug there is a bug in the way jimp behaves help wanted
Projects
None yet
Development

No branches or pull requests

4 participants