#include <stdio.h>
#include <curl/curl.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#define true 1
#define false 0
typedef unsigned int bool;
char buf[10240]={'\0'};
size_t readData(void *ptr,size_t size,size_t nmemb,void *stream)
{
//char buf[10240]={'\0'};
strcpy(buf,ptr,10240);
//printf("=====get Data=====\n");
//printf("%s\n",buf);
}
char *getPicBase64FromFile(char *filepath)
{
char *bufpic;
char cmd[128]={'\0'};
sprintf(cmd,"base64 %s > tmpFile",filepath);
system(cmd);
int fd=open("./tmpFile",O_RDWR);
int filelen=lseek(fd,0,SEEK_END);
lseek(fd,0,SEEK_SET);
bufpic=(char *)malloc(filelen+2);
memset(bufpic,'\0',filelen+2);
read(
基于树莓派的智能家居系统(三十一)——加入图片base64编码
最新推荐文章于 2024-06-02 00:09:23 发布