Okey finally i got it,The external app already encode to img to bytes but in the backend i created the variable image like a byte[] instead of a String this made that the image chain were encoding again. The solution was refactor the variable image to a String and in the frontend get sanitize the img to get his mime type with this function:
sanitizeBase64Image(imageData: string): string {
if (!imageData) {
return 'assets/default-product.jpg';
}
const mimeType = imageData.startsWith('iVBOR') ? 'image/png' :
imageData.startsWith('/9j/') ? 'image/jpeg' :
//Add more conditions for other image types if needed
'image/octet-stream';
return `data:${mimeType};base64,${imageData}`;
}