update 'exif.obj':

1) add new function exif_get_app2 (found maker from cameras: Nikon, Canon, Panasonic)
2) small fixes

git-svn-id: svn://kolibrios.org@5009 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2014-07-22 20:43:05 +00:00
parent aca533427d
commit 9adefdc190
3 changed files with 165 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ tag_format_f8b equ 12 ;float 8 byte
align 4
txt_dp db ': ',0
txt_zap db ', ',0
txt_div db '/',0
;
@@ -212,6 +213,7 @@ db 0x87,0xac,'Image layer',0
db 0x87,0xaf,'Geo tiff directory',0
db 0x87,0xb0,'Geo tiff double params',0
db 0x87,0xb1,'Geo tiff ascii params',0
db 0x88,0x25,'GPS info',0
db 0x88,0x28,'Opto-Electric conv factor',0
db 0x88,0x29,'Interlace',0
db 0x88,0x5c,'Fax recv params',0
@@ -385,7 +387,6 @@ db 0x82,0x9a,'Exposure time',0
db 0x82,0x9d,'F number',0
db 0x88,0x22,'Exposure program',0
db 0x88,0x24,'Spectral sensitivity',0
db 0x88,0x25,'GPS info',0
db 0x88,0x27,'ISO',0
db 0x88,0x2a,'Time zone offset',0
db 0x88,0x2b,'Self timer mode',0
@@ -681,6 +682,102 @@ popad
ret
endp
;output:
; app2 - 㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD> exif.app2 (<28><><EFBFBD> 0 <20><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><><E4A0A9> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
align 4
proc exif_get_app2, app1:dword, app2:dword
pushad
mov eax,[app1]
cmp [eax],edx
je .no_suport ;<3B><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><> <20><><EFBFBD> exif.app1
mov edi,[app2]
movzx edx,word[eax+offs_m_or_i] ;if 'MM' edx=1
;<3B><><EFBFBD> <20><><EFBFBD><20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,0x010f
bt edx,0
jnc @f
ror bx,8
@@:
;<3B><EFBFBD><E0AEA2><20><>᫮ ⥣<><E2A5A3>
mov eax,[eax]
movzx ecx,word[eax]
bt edx,0
jnc @f
ror cx,8
@@:
cmp ecx,1
jl .no_suport ;<3B><20><>᫮ ⥣<><E2A5A3> <1
;<3B><><EFBFBD><EFBFBD><EFBFBD><E5AEA4> <20><> 1-<2D>
add eax,offs_tag_0
@@:
cmp word[eax],bx
je @f
add eax,tag_size
loop @b
jmp .no_suport ;<3B><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@: ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,dword[eax+4]
bt edx,0
jnc @f
ror bx,8
ror ebx,16
ror bx,8
@@:
cmp ebx,4
jle .no_suport ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,dword[eax+8]
bt edx,0
jnc @f
ror bx,8
ror ebx,16
ror bx,8
@@:
;<3B><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A5AB>
mov eax,[app1]
add ebx,[eax+4]
cmp dword[ebx],'Cano'
je .suport
cmp dword[ebx],'NIKO'
je .suport
cmp dword[ebx],'Pana'
je .suport
;<3B><><EFBFBD> <20><><EFBFBD><E2A0AB><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jmp .no_suport
.suport:
;<3B><><EFBFBD><E5AEA4> ⥣ 0x8769 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Exif)
stdcall exif_get_app1_child, eax,edi,0x8769
cmp dword[edi],0
je .no_suport
;<3B><><EFBFBD><E5AEA4> ⥣ 0xa005 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Maker <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
stdcall exif_get_app1_child, edi,edi, 0x927c
cmp dword[edi],0
je .no_suport
cmp dword[ebx],'NIKO'
jne @f
add dword[edi],18 ;for Nikon
@@:
cmp dword[ebx],'Pana'
jne @f
add dword[edi],12 ;for Panasonic
@@:
jmp @f
.no_suport:
mov dword[edi],0
@@:
popad
ret
endp
;description:
; <20><EFBFBD><E1AFAE><EFBFBD><EFBFBD>⥫쭠<E2A5AB> <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E2A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7A5AD><><E2A5A3>
;input:
@@ -732,13 +829,17 @@ proc read_tag_value, app1:dword, t_max:dword
add esi,2
stdcall str_n_cat,edi,esi,[t_max]
jmp @f
jmp .start_read
.tag_unknown:
;<3B>᫨ ⥣ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2A0A2> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
movzx ebx,word[eax]
bt edx,0
jnc @f
ror bx,8
@@:
stdcall hex_in_str, edi, ebx,4
mov byte[edi+4],0
@@:
.start_read:
;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0ACA0><EFBFBD> <20><>
mov bx,tag_format_ui1b
@@ -750,18 +851,34 @@ proc read_tag_value, app1:dword, t_max:dword
jne .tag_01
stdcall str_n_cat,edi,txt_dp,[t_max]
call get_tag_data_size
cmp ebx,1
cmp ebx,4
jg .over4b_01
;<3B><20><><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD><E2AEA2> <20><>
cmp ebx,1
je @f
or edx,2 ;array data
mov ecx,dword[eax+8]
mov dh,bl
@@:
;<3B>᫨ 1 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2AEA2> <20><>
movzx ebx,byte[eax+8]
;bt edx,0
;jnc @f
; ror bx,8
;@@:
stdcall str_len,edi
add edi,eax
mov eax,ebx
call convert_int_to_str ;[t_max]
bt edx,1
jnc .end_f
@@:
;<3B><20><> 2 <20><> 4 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2AEA2> <20><>
dec dh
cmp dh,0
je .end_f
shr ecx,8
stdcall str_n_cat,edi,txt_zap,[t_max]
stdcall str_len,edi
add edi,eax
movzx eax,cl
call convert_int_to_str ;[t_max]
jmp @b
.over4b_01:
;...
jmp .end_f
@@ -808,8 +925,16 @@ proc read_tag_value, app1:dword, t_max:dword
jne .tag_03
stdcall str_n_cat,edi,txt_dp,[t_max]
call get_tag_data_size
cmp ebx,1
cmp ebx,2
jg .over4b_03
jne @f
;<3B><20><><EFBFBD> 2 <20><><EFBFBD><EFBFBD><E2AEA2> <20><>
or edx,2 ;array data
movzx ecx,word[eax+10]
bt edx,0
jnc @f
ror cx,8
@@:
;<3B><20><><EFBFBD><EFBFBD> 2 <20><><EFBFBD><EFBFBD><E2AEA2> <20><>
movzx ebx,word[eax+8]
bt edx,0
@@ -820,6 +945,14 @@ proc read_tag_value, app1:dword, t_max:dword
add edi,eax
mov eax,ebx
call convert_int_to_str ;[t_max]
bt edx,1 ;array ?
jnc .end_f
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 2-<2D> <20><>
stdcall str_n_cat,edi,txt_zap,[t_max]
stdcall str_len,edi
add edi,eax
mov eax,ecx
call convert_int_to_str ;[t_max]
.over4b_03:
;...
jmp .end_f
@@ -1079,7 +1212,9 @@ EXPORTS:
dd sz_exif_get_app1, exif_get_app1
dd sz_exif_get_app1_tag, exif_get_app1_tag
dd sz_exif_get_app1_child, exif_get_app1_child
dd sz_exif_get_app2, exif_get_app2
dd 0,0
sz_exif_get_app1 db 'exif_get_app1',0
sz_exif_get_app1_tag db 'exif_get_app1_tag',0
sz_exif_get_app1_child db 'exif_get_app1_child',0
sz_exif_get_app2 db 'exif_get_app2',0