0

Question - ngx-image-cropper doesn't accept Heic image files as it's '[imageChangedEvent]' input so how would I convert an Heic image file to a Jpeg or Png in Angular/typescript?

FYI - I'm loading images into ngx-image-cropper and it looks like it doesn't except Heic image files. Ngx-image-cropper is emitting a loadImageFailed() emitter if the file type is 'image/heic'.

Currently I open image files with a fileChangeEvent() from an input element, I guess I want to convert to a jpeg or png so that I can pass it to a the ngx-imge-cropper imageChangedEvent or it's base64 input?

chuckd
  • 13,460
  • 29
  • 152
  • 331

1 Answers1

1

There is one NPM package named Heic2any you can use this for image conversion.

This answer might help you with image conversion. Please take a look into this

Heic2any:

Official doc

NPM Package

Manish Patidar
  • 526
  • 4
  • 14
  • 1
    Ya I saw that, I'm just wondering if there's a better solution? Do you know if it's possible to load the heic into a canvas and then extract the dataurl from the canvas as a jpeg? – chuckd Apr 05 '22 at 04:53