Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
JavaScript w/ Cordova Camera Plugin - Convert image FILE_URI to DATA_URL

I am using the cordova-plugin-camera in order to access the camera in my hybrid app. I need to capture the photo and send it for upload as base64. When capturing a photo, I can specify the following:

destinationType: Camera.DestinationType.DATA_URL

which returns an image encoded as base64. However, DATA_URL can be very memory intensive and cause app crashes or out of memory errors (as mentioned in the plugin's documentation). Because of this, my app crashes on weaker devices, so using DATA_URL is a no-go. Using the default FILE_URI should solve this problem, but my backend is configured to only accept base64 encoded images.

My question is, is there a way to convert an image from FILE_URI to DATA_URL base64 encoding?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You could download the picture from the FILE_URI and then you'd have to render the image in a canvas and then from the canvas, get the base64 using the canvas.toDataURL method.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda