Subversion Repositories Kolibri OS

Rev

Rev 5008 | Rev 5010 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5008 Rev 5009
Line 26... Line 26...
26
tag_format_f4b	 equ 11 ;float 4 byte
26
tag_format_f4b	 equ 11 ;float 4 byte
27
tag_format_f8b	 equ 12 ;float 8 byte
27
tag_format_f8b	 equ 12 ;float 8 byte
Line 28... Line 28...
28
 
28
 
29
align 4
29
align 4
-
 
30
txt_dp db ': ',0
30
txt_dp db ': ',0
31
txt_zap db ', ',0
Line 31... Line 32...
31
txt_div db '/',0
32
txt_div db '/',0
32
 
33
 
33
;
34
;
Line 210... Line 211...
210
db 0x87,0x82,'T88 options',0
211
db 0x87,0x82,'T88 options',0
211
db 0x87,0xac,'Image layer',0
212
db 0x87,0xac,'Image layer',0
212
db 0x87,0xaf,'Geo tiff directory',0
213
db 0x87,0xaf,'Geo tiff directory',0
213
db 0x87,0xb0,'Geo tiff double params',0
214
db 0x87,0xb0,'Geo tiff double params',0
214
db 0x87,0xb1,'Geo tiff ascii params',0
215
db 0x87,0xb1,'Geo tiff ascii params',0
-
 
216
db 0x88,0x25,'GPS info',0
215
db 0x88,0x28,'Opto-Electric conv factor',0
217
db 0x88,0x28,'Opto-Electric conv factor',0
216
db 0x88,0x29,'Interlace',0
218
db 0x88,0x29,'Interlace',0
217
db 0x88,0x5c,'Fax recv params',0
219
db 0x88,0x5c,'Fax recv params',0
218
db 0x88,0x5d,'Fax sub address',0
220
db 0x88,0x5d,'Fax sub address',0
219
db 0x88,0x5e,'Fax recv time',0
221
db 0x88,0x5e,'Fax recv time',0
Line 383... Line 385...
383
db 0x02,0xbc,'Application notes',0
385
db 0x02,0xbc,'Application notes',0
384
db 0x82,0x9a,'Exposure time',0
386
db 0x82,0x9a,'Exposure time',0
385
db 0x82,0x9d,'F number',0
387
db 0x82,0x9d,'F number',0
386
db 0x88,0x22,'Exposure program',0
388
db 0x88,0x22,'Exposure program',0
387
db 0x88,0x24,'Spectral sensitivity',0
389
db 0x88,0x24,'Spectral sensitivity',0
388
db 0x88,0x25,'GPS info',0
-
 
389
db 0x88,0x27,'ISO',0
390
db 0x88,0x27,'ISO',0
390
db 0x88,0x2a,'Time zone offset',0
391
db 0x88,0x2a,'Time zone offset',0
391
db 0x88,0x2b,'Self timer mode',0
392
db 0x88,0x2b,'Self timer mode',0
392
db 0x88,0x30,'Sensitivity type',0
393
db 0x88,0x30,'Sensitivity type',0
393
db 0x88,0x31,'Standard output sensitivity',0
394
db 0x88,0x31,'Standard output sensitivity',0
Line 679... Line 680...
679
	.end_f:
680
	.end_f:
680
popad
681
popad
681
	ret
682
	ret
682
endp
683
endp
Line -... Line 684...
-
 
684
 
-
 
685
;output:
-
 
686
; app2 - 㪠§ â¥«ì ­  ­ ç «® exif.app2 (¨«¨ 0 ¥á«¨ ­¥ ­ ©¤¥­® ¨«¨ ä®à¬ â ä ©«  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï)
-
 
687
align 4
-
 
688
proc exif_get_app2, app1:dword, app2:dword
-
 
689
pushad
-
 
690
	mov eax,[app1]
-
 
691
	cmp [eax],edx
-
 
692
	je .no_suport ;¥á«¨ ­¥ ­ ©¤¥­ 㪠§ â¥«ì ­  ­ ç «® exif.app1
-
 
693
 
-
 
694
	mov edi,[app2]
-
 
695
	movzx edx,word[eax+offs_m_or_i] ;if 'MM' edx=1
-
 
696
 
-
 
697
	;­ ç «® ¯®¨áª  ¯à®¨§¢®¤¨â¥«ï ª ¬¥àë
-
 
698
	mov ebx,0x010f
-
 
699
	bt edx,0
-
 
700
	jnc @f
-
 
701
		ror bx,8
-
 
702
	@@:
-
 
703
 
-
 
704
	;¯à®¢¥à塞 ç¨á«® ⥣®¢
-
 
705
	mov eax,[eax]
-
 
706
	movzx ecx,word[eax]
-
 
707
	bt edx,0
-
 
708
	jnc @f
-
 
709
		ror cx,8
-
 
710
	@@:
-
 
711
	cmp ecx,1
-
 
712
	jl .no_suport ;¥á«¨ ç¨á«® ⥣®¢ <1
-
 
713
 
-
 
714
	;¯¥à¥å®¤¨¬ ­  1-© ⥣
-
 
715
	add eax,offs_tag_0
-
 
716
	@@:
-
 
717
		cmp word[eax],bx
-
 
718
		je @f
-
 
719
		add eax,tag_size
-
 
720
		loop @b
-
 
721
	jmp .no_suport ;¥á«¨ ­¥ ­ ©¤¥­®
-
 
722
	@@: ;¥á«¨ ­ ©¤¥­®	
-
 
723
		mov ebx,dword[eax+4]
-
 
724
		bt edx,0
-
 
725
		jnc @f
-
 
726
			ror bx,8
-
 
727
			ror ebx,16
-
 
728
			ror bx,8
-
 
729
		@@:
-
 
730
		cmp ebx,4
-
 
731
		jle .no_suport ;­ §¢ ­¨¥ ¯à®¨§¢®¤¨â¥«ï ¬¥­ìè¥ 4 ᨬ¢®«®¢, ­¥ ¯®¤¤¥à¦¨ ¢ ¥âáï
-
 
732
 
-
 
733
		mov ebx,dword[eax+8]
-
 
734
		bt edx,0
-
 
735
		jnc @f
-
 
736
			ror bx,8
-
 
737
			ror ebx,16
-
 
738
			ror bx,8
-
 
739
		@@:
-
 
740
	
-
 
741
	;¯à®¢¥àª  ¯®¤¤¥à¦¨¢ ¥¬ëå ¯à®¨§¢®¤¨â¥«¥©
-
 
742
	mov eax,[app1]
-
 
743
	add ebx,[eax+4]
-
 
744
	cmp dword[ebx],'Cano'
-
 
745
	je .suport
-
 
746
	cmp dword[ebx],'NIKO'
-
 
747
	je .suport
-
 
748
	cmp dword[ebx],'Pana'
-
 
749
	je .suport
-
 
750
 
-
 
751
	;¢á¥ ®áâ «ì­ë¥ ­¥ ¯®¤¤¥à¦¨¢ îâáï
-
 
752
	jmp .no_suport
-
 
753
 
-
 
754
	.suport:
-
 
755
	;­ å®¤¨¬ ⥣ 0x8769 (à áè¨à¥­­ë¥ ¤ ­­ë¥ ¯® Exif)
-
 
756
	stdcall exif_get_app1_child, eax,edi,0x8769
-
 
757
	cmp dword[edi],0
-
 
758
	je .no_suport
-
 
759
	;­ å®¤¨¬ ⥣ 0xa005 (¤ ­­ë¥ Maker ¯® ª ¬¥à¥)
-
 
760
	stdcall exif_get_app1_child, edi,edi, 0x927c
-
 
761
	cmp dword[edi],0
-
 
762
	je .no_suport
-
 
763
 
-
 
764
	cmp dword[ebx],'NIKO'
-
 
765
	jne @f
-
 
766
		add dword[edi],18 ;for Nikon
-
 
767
	@@:
-
 
768
	cmp dword[ebx],'Pana'
-
 
769
	jne @f
-
 
770
		add dword[edi],12 ;for Panasonic
-
 
771
	@@:
-
 
772
 
-
 
773
	jmp @f
-
 
774
	.no_suport:
-
 
775
		mov dword[edi],0
-
 
776
	@@:
-
 
777
popad
-
 
778
	ret
-
 
779
endp
683
 
780
 
684
;description:
781
;description:
685
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï ¤«ï ç⥭¨ï ­ §­ ç¥­¨© ⥣®¢
782
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï ¤«ï ç⥭¨ï ­ §­ ç¥­¨© ⥣®¢
686
;input:
783
;input:
687
; eax - 㪠§ â¥«ì ­ ç «  ⥣ 
784
; eax - 㪠§ â¥«ì ­ ç «  ⥣ 
Line 730... Line 827...
730
 
827
 
731
	;ª®¯¨à㥬 áâபã á ­ §¢ ­¨¥¬ ⥣ 
828
	;ª®¯¨à㥬 áâபã á ­ §¢ ­¨¥¬ ⥣ 
732
	add esi,2
829
	add esi,2
Line 733... Line 830...
733
	stdcall str_n_cat,edi,esi,[t_max]
830
	stdcall str_n_cat,edi,esi,[t_max]
734
 
831
 
735
	jmp @f
832
	jmp .start_read
736
	.tag_unknown:
833
	.tag_unknown:
-
 
834
		;¥á«¨ ⥣ ­¥ ­ ©¤¥­ áâ ¢¨¬ ¥£® ª®¤ ¢¬¥áâ® ­ §¢ ­¨ï
-
 
835
		movzx ebx,word[eax]
-
 
836
		bt edx,0
-
 
837
		jnc @f
737
		;¥á«¨ ⥣ ­¥ ­ ©¤¥­ áâ ¢¨¬ ¥£® ª®¤ ¢¬¥áâ® ­ §¢ ­¨ï
838
			ror bx,8
738
		movzx ebx,word[eax]
839
		@@:
739
		stdcall hex_in_str, edi, ebx,4
840
		stdcall hex_in_str, edi, ebx,4
Line 740... Line 841...
740
		mov byte[edi+4],0
841
		mov byte[edi+4],0
741
	@@:
842
	.start_read:
742
 
843
 
743
	;ç¨â ¥¬ ¨­ä®à¬ æ¨î ¢ ⥣¥
844
	;ç¨â ¥¬ ¨­ä®à¬ æ¨î ¢ ⥣¥
Line 748... Line 849...
748
	@@:
849
	@@:
749
	cmp word[eax+2],bx
850
	cmp word[eax+2],bx
750
	jne .tag_01
851
	jne .tag_01
751
		stdcall str_n_cat,edi,txt_dp,[t_max]
852
		stdcall str_n_cat,edi,txt_dp,[t_max]
752
		call get_tag_data_size
853
		call get_tag_data_size
753
		cmp ebx,1
854
		cmp ebx,4
754
		jg .over4b_01
855
		jg .over4b_01
-
 
856
		cmp ebx,1
-
 
857
		je @f
-
 
858
			or edx,2 ;array data
-
 
859
			mov ecx,dword[eax+8]
-
 
860
			mov dh,bl
-
 
861
		@@:
755
			;¥á«¨ ®¤­® 1 ¡ ©â®¢®¥ ç¨á«®
862
			;¥á«¨ 1 ®¤­® ¡ ©â®¢®¥ ç¨á«®
756
			movzx ebx,byte[eax+8]
863
			movzx ebx,byte[eax+8]
757
			;bt edx,0
-
 
758
			;jnc @f
-
 
759
			;	ror bx,8
-
 
760
			;@@:
-
 
761
			stdcall str_len,edi
864
			stdcall str_len,edi
762
			add edi,eax
865
			add edi,eax
763
			mov eax,ebx
866
			mov eax,ebx
764
			call convert_int_to_str ;[t_max]
867
			call convert_int_to_str ;[t_max]
-
 
868
			bt edx,1
-
 
869
			jnc .end_f
-
 
870
			@@:
-
 
871
				;¥á«¨ ®â 2 ¤® 4 ®¤­® ¡ ©â®¢ëå ç¨á¥«
-
 
872
				dec dh
-
 
873
				cmp dh,0
-
 
874
				je .end_f
-
 
875
				shr ecx,8
-
 
876
				stdcall str_n_cat,edi,txt_zap,[t_max]
-
 
877
				stdcall str_len,edi
-
 
878
				add edi,eax
-
 
879
				movzx eax,cl
-
 
880
				call convert_int_to_str ;[t_max]
-
 
881
				jmp @b
765
		.over4b_01:
882
		.over4b_01:
766
			;...
883
			;...
767
		jmp .end_f
884
		jmp .end_f
768
	.tag_01:
885
	.tag_01:
Line 806... Line 923...
806
	@@:
923
	@@:
807
	cmp word[eax+2],bx
924
	cmp word[eax+2],bx
808
	jne .tag_03
925
	jne .tag_03
809
		stdcall str_n_cat,edi,txt_dp,[t_max]
926
		stdcall str_n_cat,edi,txt_dp,[t_max]
810
		call get_tag_data_size
927
		call get_tag_data_size
811
		cmp ebx,1
928
		cmp ebx,2
812
		jg .over4b_03
929
		jg .over4b_03
-
 
930
		jne @f
-
 
931
			;¥á«¨ ¤¢  2 ¡ ©â®¢ëå ç¨á« 
-
 
932
			or edx,2 ;array data
-
 
933
			movzx ecx,word[eax+10]
-
 
934
			bt edx,0
-
 
935
			jnc @f
-
 
936
				ror cx,8
-
 
937
			@@:
813
			;¥á«¨ ®¤­® 2 ¡ ©â®¢®¥ ç¨á«®
938
			;¥á«¨ ®¤­® 2 ¡ ©â®¢®¥ ç¨á«®
814
			movzx ebx,word[eax+8]
939
			movzx ebx,word[eax+8]
815
			bt edx,0
940
			bt edx,0
816
			jnc @f
941
			jnc @f
817
				ror bx,8
942
				ror bx,8
818
			@@:
943
			@@:
819
			stdcall str_len,edi
944
			stdcall str_len,edi
820
			add edi,eax
945
			add edi,eax
821
			mov eax,ebx
946
			mov eax,ebx
822
			call convert_int_to_str ;[t_max]
947
			call convert_int_to_str ;[t_max]
-
 
948
			bt edx,1 ;array ?
-
 
949
			jnc .end_f
-
 
950
			;¤®¡ ¢«ï¥¬ 2-¥ ç¨á«®
-
 
951
			stdcall str_n_cat,edi,txt_zap,[t_max]
-
 
952
			stdcall str_len,edi
-
 
953
			add edi,eax
-
 
954
			mov eax,ecx
-
 
955
			call convert_int_to_str ;[t_max]
823
		.over4b_03:
956
		.over4b_03:
824
			;...
957
			;...
825
		jmp .end_f
958
		jmp .end_f
826
	.tag_03:
959
	.tag_03:
Line 1077... Line 1210...
1077
align 16
1210
align 16
1078
EXPORTS:
1211
EXPORTS:
1079
	dd sz_exif_get_app1, exif_get_app1
1212
	dd sz_exif_get_app1, exif_get_app1
1080
	dd sz_exif_get_app1_tag, exif_get_app1_tag
1213
	dd sz_exif_get_app1_tag, exif_get_app1_tag
1081
	dd sz_exif_get_app1_child, exif_get_app1_child
1214
	dd sz_exif_get_app1_child, exif_get_app1_child
-
 
1215
	dd sz_exif_get_app2, exif_get_app2
1082
	dd 0,0
1216
	dd 0,0
1083
	sz_exif_get_app1 db 'exif_get_app1',0
1217
	sz_exif_get_app1 db 'exif_get_app1',0
1084
	sz_exif_get_app1_tag db 'exif_get_app1_tag',0
1218
	sz_exif_get_app1_tag db 'exif_get_app1_tag',0
1085
	sz_exif_get_app1_child db 'exif_get_app1_child',0
1219
	sz_exif_get_app1_child db 'exif_get_app1_child',0
-
 
1220
	sz_exif_get_app2 db 'exif_get_app2',0