jimp-dev / jimp-dev/jimp

TIFF to JPEG conversion with strange behavior

Open
#664 5 comments 1 reaction 0 assignees View on GitHub
bug issue-in-dependency
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

I am trying to generate a thumbnail of a TIFF, in JPEG, and render it using base64.
But the thing is, in some files I got this strange result below.

Original image looks like this, with transparent background:
![1](https://user-images.githubusercontent.com/324830/48952690-36b07900-ef2a-11e8-9042-5e06662665ee.png)

# Expected Behavior

It should look like this, just with an white background.
![3](https://user-images.githubusercontent.com/324830/48952711-4cbe3980-ef2a-11e8-9368-e85dd822e3c4.png)

# Current Behavior

It looks like it lost its color, it is repeated and some other stuff, as you can see.
![2](https://user-images.githubusercontent.com/324830/48952743-66f81780-ef2a-11e8-81e5-e69b151d180d.png)

# Failure Information (for bugs)

This conversion has been tried on other tiff images, with different compression types and different settings for saving transparent pixels. In some of them everything goes fine, on other ones this strange result is given.

## Steps to Reproduce

This is the code that is being used for generating this conversion:

```
Jimp
.read(imagePath)
.then(image => {
image
.resize(Jimp.AUTO, 350)
.background(0xFFFFFFFF)
.getBase64Async(Jimp.MIME_JPEG)
.then(base64Image => document.getElementById('image').src = base64Image
.catch(err => ...)
})
.catch(err => ...)
```

## Context

- Jimp Version: 0.5.6
- Operating System: Debian 9, Windows 10
- Node version: running on Electron (node 10.2)

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.