'EXIF Orientation on tablet upload

I have a function to upload user images for their profiles. When uploaded via desktop the orientation stays the same, however when uploading from a Samsung A& tablet the orientation is always rotated 90 degrees (landscape) is there any way to force or keep the original upload? Developed using Angular. I have looked through many posts but can't seem to get a solution for this.

HTML -

<label>
  <img id="userImage" [src]="imageSrc" src-fallback="{{defaultImage}}" class="img-circle" (click)="imgUpload">
    <div [hidden]="imgUpload" #imgUpload id="imgUpload">
    <input type="file" class="img-circle" (change)="onFileChanged($event)" accept="image/jpg,image/png,image/jpeg" [disabled]="!isConnected">
  </div>
  <div class="small-img">
    <i class="fas fa-camera"></i>
  </div>
</label>

TS -

upload() {
const hashedServiceUserId = this.s3Service.getServiceUserIdHash(this.serviceUserId);
this.backendLambdaService.getServiceUserImageUploadUrl(hashedServiceUserId, this.selectedFile.type)
  .pipe()
  .subscribe(res => {
    this.url = res.signedUrl;
    this.s3Service.upload(res.signedUrl, this.selectedFile)
      .subscribe(async event => {
        console.log(event);
        if (!(event instanceof HttpHeaderResponse) || event.status === 200) {
          await this.photoService.fetchAndStoreNewSignedUrl(this.serviceUserId);
        }
      });
  }, error => {
    console.log(error);
  });

}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source