jimp-dev/jimp

when rotate, the width and height of pic gets larger

Open

#808 geöffnet am 25. Okt. 2019

Auf GitHub ansehen
 (0 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)JavaScript (785 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (13.218 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

When I call roatet serval on the same object, the width and height of pic gets larger. after call rotate about 10 times, the pic will have a quiet obvious black border.

The follwoing code:

Jimp.read('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/koala.jpg', (error, lenna) => {
        if (error) throw error;
        lenna
          .rotate(90)
          .rotate(90)
          .rotate(90)
          .rotate(90)
          .rotate(90)
          .rotate(90)
          .rotate(90)
          .getBase64(Jimp.AUTO, (err, base64) => {
            this.imageRef.setAttribute('src', base64);
          });
      });

Expected Behavior

The pic rotate with the original width and height.

Current Behavior

the pic will have black border ,the width and height of pic will grow evey time.

Context

  • Jimp Version: ^0.8.5
  • Operating System: win10
  • Node version: v10.16.3

Contributor Guide