question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rotation adds black border

See original GitHub issue

Expected Behavior

When the image is rotated, the image is identical to the original

Current Behavior

A black border (1px) is added

Failure Information (for bugs)

Steps to Reproduce

(typescript)

Jimp.read(this._encodedImgDataUrl).then(jimpContext => {
            jimpContext.rotate(degrees, false).getBase64(this._mime, (_instance_, result: string) => {
                this._globalRender(result);
            });
        });

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

  1. step 1
  2. step 2
  3. you get it… -->

Screenshots

Context

  • Jimp Version: 0.6.1
  • Operating System: Win 10
  • Node version: 8.15.0

Failure Logs

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:13
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
toolekscommented, Jun 21, 2019

I faced the same problem.

Here is the jsfiddle to reproduce the issue.

2reactions
soimycommented, Jul 9, 2019

After some digging, I found this issue is introduced by #708 most of the time we just need simple 90-degree rotation, and advancedRotate() on 90/270 degree will result in total size change.

Workaround: implement your own simpleRotate() method using https://github.com/oliver-moran/jimp/blob/736054ef1bea6b6fb03db3e75f05cd922a9c104f/packages/plugin-rotate/src/index.js#L3-L20

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rotating a BufferedImage gives it a black border [duplicate]
I try to rotate a BufferedImage and it works, but the rotated image has a black border around some sides and I don't...
Read more >
Motion Tile & RepeTile problem with black borders
I applied Motion Tile effect and tried to make a rotation transition, but when i rotate the 100% scaled video, the black borders...
Read more >
Premiere Pro CC : How to Remove Black Border Around Video
A tutorial on how to remove the black borders and space around a video clip in Premiere Pro CC.
Read more >
Remove Black Bars without Image stretch & Rotate/Flip media ...
To top it off , some pictures than needed rotating ended up adding extra black boarders (after the rotation) on top and bottom...
Read more >
iPhone rotatin black border re-enabling itself when changing ...
I'm trying to make this black border go away and have read that it's related to apple's onscreen keyboard. So disabling the rotation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found