-
-
Save mjunaidi/f6615cec7f6d006642aa7ee6cb9b89a0 to your computer and use it in GitHub Desktop.
get image mime type from base64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function guessImageMime(data){ | |
if(data.charAt(0)=='/'){ | |
return "image/jpeg"; | |
}else if(data.charAt(0)=='R'){ | |
return "image/gif"; | |
}else if(data.charAt(0)=='i'){ | |
return "image/png"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment