only handle JPEG, return otherwise (CID 15)

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10191 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2007-05-11 18:19:03 +00:00
parent eac610fabe
commit 6147fe2a18

View File

@@ -258,21 +258,23 @@ long get_file(GPPort *port,char *name, char **data, int format, int verbose)
if(F1fopen(port,name) != 0)
return(0);
/* printf("camfile: %s\n",name); */
if(format == JPEG){
len = F1fread(port, buf, 126);
if( len < 126){
F1fclose(port);
return(0);
}
/*write_file(jpeg_comment, make_jpeg_comment(buf, jpeg_comment), fp);*/
memcpylen=make_jpeg_comment(buf, jpeg_comment);
ptr = malloc(memcpylen+filelen);
*data=ptr;
ptr = memcpy(ptr,jpeg_comment,memcpylen);
total = 126;
ptr +=memcpylen;
if(format != JPEG)
return(0);
len = F1fread(port, buf, 126);
if( len < 126){
F1fclose(port);
return(0);
}
/*write_file(jpeg_comment, make_jpeg_comment(buf, jpeg_comment), fp);*/
memcpylen=make_jpeg_comment(buf, jpeg_comment);
ptr = malloc(memcpylen+filelen);
*data=ptr;
ptr = memcpy(ptr,jpeg_comment,memcpylen);
total = 126;
ptr +=memcpylen;
while((len = F1fread(port, buf, 0x0400)) != 0){
if(len < 0)