From 6147fe2a1831d3eed67343fc179cce9dde2dcd7d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 11 May 2007 18:19:03 +0000 Subject: [PATCH] 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 --- camlibs/sonydscf1/chotplay.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/camlibs/sonydscf1/chotplay.c b/camlibs/sonydscf1/chotplay.c index ea8b19aee..76f66def0 100644 --- a/camlibs/sonydscf1/chotplay.c +++ b/camlibs/sonydscf1/chotplay.c @@ -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)