Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
6ddc329c
Commit
6ddc329c
authored
Mar 29, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed another exif bug, generated goot tiff
parent
53ba16e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
exif393.c
src/drivers/elphel/exif393.c
+14
-11
No files found.
src/drivers/elphel/exif393.c
View file @
6ddc329c
...
...
@@ -804,6 +804,7 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
int
sensor_port
;
char
tmp
[
MAX_EXIF_SIZE
];
//! Or is it possible to disable IRQ while copy_from_user()?
int
is_tiff
=
0
;
int
template_size
;
/*
Does not work with PHP - always read 8192 bytes
if ((*off+count)>maxsize) {
...
...
@@ -851,27 +852,29 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
case
DEV393_MINOR
(
DEV393_EXIF1
):
case
DEV393_MINOR
(
DEV393_EXIF2
):
case
DEV393_MINOR
(
DEV393_EXIF3
):
sensor_port
=
(
p
-
(
(
is_tiff
)
?
DEV393_MINOR
(
DEV393_TIFF0
)
:
DEV393_MINOR
(
DEV393_EXIF0
)))
&
3
;
// &3 just to make compiler happy
sensor_port
=
(
p
-
(
is_tiff
?
DEV393_MINOR
(
DEV393_TIFF0
)
:
DEV393_MINOR
(
DEV393_EXIF0
)))
&
3
;
// &3 just to make compiler happy
//will truncate by the end of current page
if
(
!
aexif_enabled
[
sensor_port
])
return
0
;
i
=
((
int
)
*
off
)
/
exif_template_size
;
dev_dbg
(
g_devfp_ptr
,
"count= 0x%x, *off= 0x%x, i=0x%x, exif_template_size=0x%x
\n
"
,
(
int
)
count
,
(
int
)
*
off
,
(
int
)
i
,
(
int
)
exif_template_size
);
//arch/cris/arch-v32/drivers/elphel/exif353.c:590:count= 0x2000, *off= 0x410, i=0x82, exif_template_size=0x208
start_p
=
i
*
exif_template_size
;
template_size
=
is_tiff
?
tiff_template_size
:
exif_template_size
;
i
=
((
int
)
*
off
)
/
template_size
;
dev_dbg
(
g_devfp_ptr
,
"count= 0x%x, *off= 0x%x, i=0x%x, template_size=0x%x
\n
"
,
(
int
)
count
,
(
int
)
*
off
,
(
int
)
i
,
(
int
)
template_size
);
//arch/cris/arch-v32/drivers/elphel/exif353.c:590:count= 0x2000, *off= 0x410, i=0x82, template_size=0x208
start_p
=
i
*
template_size
;
page_p
=
*
off
-
start_p
;
dev_dbg
(
g_devfp_ptr
,
"count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x, i=0x%x,
exif_template_size=0x%x
\n
"
,
(
int
)
count
,
(
int
)
*
off
,
(
int
)
start_p
,
(
int
)
page_p
,(
int
)
i
,
(
int
)
exif_
template_size
);
//arch/cris/arch-v32/drivers/elphel/exif353.c:591:count= 0x2000, pos= 0x410, start_p=0x10810, page_p=0xfffefc00, i=0x82,
exif_
template_size=0x208
dev_dbg
(
g_devfp_ptr
,
"count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x, i=0x%x,
template_size=0x%x
\n
"
,
(
int
)
count
,
(
int
)
*
off
,
(
int
)
start_p
,
(
int
)
page_p
,(
int
)
i
,
(
int
)
template_size
);
//arch/cris/arch-v32/drivers/elphel/exif353.c:591:count= 0x2000, pos= 0x410, start_p=0x10810, page_p=0xfffefc00, i=0x82, template_size=0x208
metap
=
&
ameta_buffer
[
sensor_port
][
i
*
aexif_meta_size
[
sensor_port
]];
// pointer to the start of the selected page in frame meta_buffer
if
((
page_p
+
count
)
>
exif_template_size
)
count
=
exif_
template_size
-
page_p
;
// memcpy(tmp,exif_template,
exif_
template_size);
if
((
page_p
+
count
)
>
template_size
)
count
=
template_size
-
page_p
;
// memcpy(tmp,exif_template, template_size);
// dev_dbg(g_devfp_ptr,"count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x\n", (int) count, (int) *off, (int)start_p, (int)page_p);
if
(
is_tiff
)
{
memcpy
(
tmp
,
tiff_template
,
t
iff_t
emplate_size
);
memcpy
(
tmp
,
tiff_template
,
template_size
);
for
(
i
=
0
;
i
<
exif_fields
;
i
++
)
{
if
(
dir_table
[
i
].
dst_tiff
>
0
)
memcpy
(
&
tmp
[
dir_table
[
i
].
dst_tiff
],
&
metap
[
dir_table
[
i
].
src
],
dir_table
[
i
].
len
);
}
}
else
{
memcpy
(
tmp
,
exif_template
,
exif_
template_size
);
memcpy
(
tmp
,
exif_template
,
template_size
);
for
(
i
=
0
;
i
<
exif_fields
;
i
++
)
{
if
(
dir_table
[
i
].
dst_exif
>
0
)
memcpy
(
&
tmp
[
dir_table
[
i
].
dst_exif
],
&
metap
[
dir_table
[
i
].
src
],
dir_table
[
i
].
len
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment