Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Convert .HEIC/.HEIC to .jpeg and then convert the jpeg to base64 using ionic/angular

I'm currently using ionic 5 and cordova.

I use https://ionicframework.com/docs/native/camera to access my photo galary in ios device.

AIM: Default ios captures .heic type image i want to convert selected image to .jpeg and then that .jpeg need to be converted to base64

this is my camera options:

    const options: CameraOptions = {
          quality: 50,
          sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
          destinationType: this.camera.DestinationType.FILE_URI,
          encodingType: this.camera.EncodingType.JPEG,
          mediaType: this.camera.MediaType.PICTURE
        };
    
    this.camera.getPicture(options).then((dataUrl) => {
          console.log('imageUri : ', dataUrl);
          this.imageToBase64(dataUrl)
            .subscribe((res: Blob)=>{
            const ref = this;
            const reader = new FileReader();
            reader.readAsDataURL(res);
            reader.onload = ()=>{
              console.log('reader',reader);
              ref.base64 = reader.result.toString();
            };
      });
      console.log('imageToBase64',this.base64);
    });

    imageToBase64(img): Observable<any>{
        return  this.httpClient.get(img,{responseType: 'blob'});
    }

my console gives => enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!