This post was supposed to go in this thread, not Indesign Links:
have to take the spaces out of the base64 text, write it to a file or
modify
the function below to just take a text string.
I found this on
http://us2.php.net/manual/en/function.base64-decode.php
<?php
function base64_to_jpeg( $inputfile, $outputfile ) {
/* read data (binary) */
$ifp = fopen( $inputfile, "rb" );
$imageData = fread( $ifp, filesize( $inputfile ) );
fclose( $ifp );
/* encode & write data (binary) */
$ifp = fopen( $outputfile, "wb" );
fwrite( $ifp, base64_decode( $imageData ) );
fclose( $ifp );
/* return output filename */
return( $outputfile );
}
?>
This gives me an actual jpeg file to work with, which is very good.