Rotation adds black border
See original GitHub issueExpected 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
- step 1
- step 2
- you get it… -->
Screenshots
Context
- Jimp Version: 0.6.1
- Operating System: Win 10
- Node version: 8.15.0
Failure Logs
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:20 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I faced the same problem.
Here is the jsfiddle to reproduce the issue.
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