summaryrefslogtreecommitdiff
path: root/camlibs/jl2005c
diff options
context:
space:
mode:
authorTheodore Kilgore <kilgota@auburn.edu>2007-09-26 00:45:49 +0000
committerTheodore Kilgore <kilgota@auburn.edu>2007-09-26 00:45:49 +0000
commitda5db5d688dae39ccc5ff186260771fe170e741e (patch)
tree232dbd8f80520073e70ed025eff72870b96fe511 /camlibs/jl2005c
parentda7eb6b2985796100f704b5394b137ed1c8c461b (diff)
downloadlibgphoto2-da5db5d688dae39ccc5ff186260771fe170e741e.tar.gz
camlibs/jl2005c: minor changes to computation of data size and start point for photos
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10734 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/jl2005c')
-rw-r--r--camlibs/jl2005c/jl2005c.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/camlibs/jl2005c/jl2005c.c b/camlibs/jl2005c/jl2005c.c
index 1eccbdd21..7474889dc 100644
--- a/camlibs/jl2005c/jl2005c.c
+++ b/camlibs/jl2005c/jl2005c.c
@@ -165,8 +165,7 @@ jl2005c_get_pic_data_size (Info *info, int n)
{
int size;
GP_DEBUG("info[48+16*n+7] = %02X\n", info[48+16*n+7]);
- GP_DEBUG("info[48+16*n+8] = %02X\n", info[48+16*n+8]);
- size = (info[48+16*n+7]*0x200 + info[48+16*n+8]*0x2);
+ size = (info[48+16*n+7]*0x200);
GP_DEBUG("size = 0x%x = %d\n", size, size);
return (size);
}
@@ -174,14 +173,12 @@ jl2005c_get_pic_data_size (Info *info, int n)
unsigned long
jl2005c_get_start_of_photo(Info *info, unsigned int n)
{
- int j = 0;
unsigned long start = 0;
- if (!n)
- return 0;
- while (j < n) {
- start += jl2005c_get_pic_data_size(info,j);
- j++;
- }
+ start = (info[48+16*n+12]&0xff)*0x100;
+ start -= 0x400;
+ start += info[48+16*n+13]&0xff;
+ start *= 0x200;
+
return start;
}