blueimp / JavaScript-Load-Image

Load images provided as File or Blob objects or via URL. Retrieve an optionally scaled, cropped or rotated HTML img or canvas element. Use methods to parse image metadata to extract IPTC and Exif tags as well as embedded thumbnail images, to overwrite the Exif Orientation value and to restore the complete image header after resizing.
https://blueimp.github.io/JavaScript-Load-Image/
MIT License
4.46k stars 923 forks source link

Image is not well rotated on Android 8 #126

Closed ProtocolNebula closed 4 years ago

ProtocolNebula commented 4 years ago

Hi,

I installed the package the previous week to fix the rotation image issue in latest iOs versions, but today we notice that the image is get rotated in Android 8 (my current phone) with the latest WebKit version (we wrapp the application with cordova.js and is written in top of Angular 9).

The bug is only for vertical images.

Android details:

This is the code I'm using to read and rotate the image:

return from(
  loadImage(file.file, {
    canvas: true,
    maxWidth: this.optimizeImages.maxWidth,
    maxHeight: this.optimizeImages.maxHeight,
    orientation: true,
  })
).pipe(
  switchMap(
    (data: any) =>
      new Observable((observable) => {
        data.image.toBlob((blob) => {
          data.blob = blob;
          observable.next(data);
          observable.complete();
        }, "image/jpeg");
      })
  )
).subscribe(() => {});

Any suggestion?

Thanks, Best regards.

ProtocolNebula commented 4 years ago

Fixed, it was a bug with a cordova.js plugin.

blueimp commented 4 years ago

Glad you could fix it and thanks for clearing that up @ProtocolNebula!