Changeset 7740 for platform/tdiary/lib
- Timestamp:
- 03/10/08 05:57:05 (9 months ago)
- Location:
- platform/tdiary/lib/exifparser
- Files:
-
- 13 modified
-
ChangeLog (modified) (7 diffs)
-
lib/exifparser.rb (modified) (13 diffs)
-
lib/exifparser/makernote/canon.rb (modified) (7 diffs)
-
lib/exifparser/makernote/fujifilm.rb (modified) (15 diffs)
-
lib/exifparser/makernote/minolta.rb (modified) (2 diffs)
-
lib/exifparser/makernote/nikon.rb (modified) (10 diffs)
-
lib/exifparser/makernote/nikon2.rb (modified) (4 diffs)
-
lib/exifparser/makernote/olympus.rb (modified) (6 diffs)
-
lib/exifparser/makernote/prove.rb (modified) (5 diffs)
-
lib/exifparser/scan.rb (modified) (12 diffs)
-
lib/exifparser/tag.rb (modified) (91 diffs)
-
lib/exifparser/thumbnail.rb (modified) (1 diff)
-
lib/exifparser/utils.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/lib/exifparser/ChangeLog
r4808 r7740 12 12 Thu Dec 12 04:05:42 2002 Ryuichi Tamura <r-tam@fsinet.or.jp> 13 13 14 * lib/exifparser/tag.rb: EXIF tag set should include 14 * lib/exifparser/tag.rb: EXIF tag set should include 15 15 'InteroperabilityIFDPointer' 16 16 17 17 Tue Dec 10 23:26:46 2002 Ryuichi Tamura <r-tam@fsinet.or.jp> 18 18 19 * lib/exifparser/scan.rb, lib/exifparser/tag.rb, 19 * lib/exifparser/scan.rb, lib/exifparser/tag.rb, 20 20 lib/exifparser/makernote/*.rb: namespaces introduced to 21 21 prevent name collision. … … 31 31 32 32 * lib/exifparser/tag.rb (Exif::Tag): missing tag classes 33 completed to make conformable with Exif Standard 2.2 33 completed to make conformable with Exif Standard 2.2 34 34 (backward compatible newest standard). 35 35 (Exif::Tag::Flash#to_s): returned value make comformable 36 36 to Exif Standard 2.2. 37 (Exif::Tag::PixelXDimension, Exif::Tag::PixelYDimension): 38 renamed from 'ExifImageWidth' and 'ExifImageLength'. 37 (Exif::Tag::PixelXDimension, Exif::Tag::PixelYDimension): 38 renamed from 'ExifImageWidth' and 'ExifImageLength'. 39 39 40 40 Sun Dec 8 15:27:27 2002 Ryuichi Tamura <r-tam@fsinet.or.jp> 41 41 42 42 * Apply following fixes/contributions by Noguchi Shingo. 43 43 44 44 * lib/exifparser/makernote/nikon2.rb, 45 lib/exifparser/makernote/minolta.rb: new files. 45 lib/exifparser/makernote/minolta.rb: new files. 46 46 47 47 * lib/exifparser/scan.rb (Exif::Scanner#scan): Tag::Model object 48 48 was generated by Tag::Model. This bug is fixed by Noguchi Shingo. 49 49 (Exif::Scanner#scan): use @byteOrder_module to instantiate 50 makernote object. In many models, the byteorder of Makernote 51 seems the same as that of IFDs. 52 50 makernote object. In many models, the byteorder of Makernote 51 seems the same as that of IFDs. 52 53 53 * lib/exifparser/makernote/*.rb (Exif::Makernote::XXX#initialize): 54 54 ditto. … … 60 60 return newly introduced models (Nikon, Nikon2, Minolta). 61 61 62 * lib/exifparser/tag.rb (Exif::Tag::Makernote#_format0, 63 Exif::Tag::Makernote#to_s): the functionality of these methods 62 * lib/exifparser/tag.rb (Exif::Tag::Makernote#_format0, 63 Exif::Tag::Makernote#to_s): the functionality of these methods 64 64 should be exchanged. 65 65 … … 86 86 87 87 * lib/exifparser/tag.rb (Exif::Tag::SubjectDistanceRange): ditto. 88 88 89 89 Wed Nov 20 13:28:16 2002 Ryuichi Tamura <r-tam@fsinet.or.jp> 90 90 91 91 * lib/exifparser/utils.rb: Utils::Pack::Motorola, 92 92 Utils::Pack::Intel: new modules. these are extended to 93 objects that require decode data. 93 objects that require decode data. 94 94 95 * lib/exifparser/scan.rb: __byteOrder__() is obsoleted. 96 objects that require decode data will extend appropriate 95 * lib/exifparser/scan.rb: __byteOrder__() is obsoleted. 96 objects that require decode data will extend appropriate 97 97 decode modules according to the byte order. 98 98 (Exif::Scanner#scan_IFD): ditto. 99 (Exif::Scanner#scan): check condition for valid EXIF 100 identifier is relaxed because some model does not provide 99 (Exif::Scanner#scan): check condition for valid EXIF 100 identifier is relaxed because some model does not provide 101 101 the correct one. 102 103 * lib/exifparser/tag.rb (Exif::Tag::Format): now returns 102 103 * lib/exifparser/tag.rb (Exif::Tag::Format): now returns 104 104 a pair of sizeof(format) and formatter module. 105 105 (Exif::Tag::Formatter): modules provide 'format' method that … … 114 114 the value of 'format' field of the data. 115 115 116 * lib/exifparser/makernote/fujifilm.rb, 116 * lib/exifparser/makernote/fujifilm.rb, 117 117 lib/exifparser/makernote/nikon.rb, 118 118 lib/exifparser/makernote/canon.rb, … … 127 127 128 128 * lib/exifparser/scan.rb (Exif::Scanner#scan): some maker does not 129 provide any identifier. So pass Exif::Tag::Make object to 129 provide any identifier. So pass Exif::Tag::Make object to 130 130 MakerNote.prove(), and use Exif::Tag::Make.value to prove the maker. 131 131 (Exif::Scanner#get_app1_datasize): wrong shift length. … … 143 143 144 144 * lib/exifparser/tag.rb: Exif::Tag::ExifImageWidth, 145 Exif::Tag::ExifImageLength - added processData() to workaround. 145 Exif::Tag::ExifImageLength - added processData() to workaround. 146 146 Exif::Tag::Base#to_name: should not use Module#nesting. revert to 147 147 original behaviour. -
platform/tdiary/lib/exifparser/lib/exifparser.rb
r4808 r7740 1 # 1 # 2 2 # 3 3 #= exifparser.rb - Exif tag parser written in pure ruby … … 9 9 # 10 10 #== INTRODUCTION 11 # 12 #There are 2 classes you work with. ExifParser class is 11 # 12 #There are 2 classes you work with. ExifParser class is 13 13 #the Exif tag parser that parses all tags defined EXIF-2.2 standard, 14 14 #and many of extension tags uniquely defined by some digital equipment … … 25 25 # #<Exif::Tag::TIFF::Make ID=0x010f, IFD="IFD0" Name="Make", Format="Ascii" Value="FUJIFILM"> 26 26 # 27 #here, ID is Tag ID defined in EXIF-2.2 standard, IFD is the name of 27 #here, ID is Tag ID defined in EXIF-2.2 standard, IFD is the name of 28 28 #Image File Directory, Name is String representation of tag ID, Format is 29 #string that shows how the data is formatted, and Value is the value of 29 #string that shows how the data is formatted, and Value is the value of 30 30 #the tag. This is retrieved by Exif::Tag::Make#value. 31 # 31 # 32 32 #Another example. If you want to know whether flash was fired when the image 33 33 #was generated, ExifParser returns Exif::Tag::Flash object: 34 # 34 # 35 35 # tag = exif['Flash'] 36 36 # p tag … … 39 39 # => 1 40 40 # 41 #It may happen that diffrent IFDs have the same tag name. In this case, 41 #It may happen that diffrent IFDs have the same tag name. In this case, 42 42 #use Exif#tag(tagname, IFD) 43 43 # 44 44 #The value of the tag above, 1, is not clearly understood 45 #(supposed to be 'true', though). Exif::Tag::Flash#to_s will provides 45 #(supposed to be 'true', though). Exif::Tag::Flash#to_s will provides 46 46 #more human-readable form as String. 47 47 # … … 54 54 # 55 55 # exif = ExifParser.new("fujifilm.jpg") 56 # 56 # 57 57 # 1. get a tag value by its name('Make') or its ID (0x010f) 58 58 # exif['Make'] #=> 'FUJIFILM' … … 69 69 # exif.tags 70 70 # 71 # or, if you want to know all the tags defined in specific IFD, 71 # or, if you want to know all the tags defined in specific IFD, 72 72 # 73 73 # exif.tags(:IFD0) # get all the tags defined in IFD0 … … 78 78 # p tag.to_s 79 79 # end 80 # 80 # 81 81 # # each tag in IFD0 82 82 # exif.each(:IFD0) do |ifd0_tag| … … 91 91 # 92 92 # dest object must respond to '<<'. 93 # 93 # 94 94 require 'exifparser/scan' 95 95 … … 135 135 136 136 # 137 # search the specified tag values. return value is object of 137 # search the specified tag values. return value is object of 138 138 # classes defined under Exif::Tag module. 139 139 # … … 185 185 else 186 186 [ 187 @IFD0,188 @IFD1,189 @Exif,190 @GPS,191 @Interoperability,192 @MakerNote187 @IFD0, 188 @IFD1, 189 @Exif, 190 @GPS, 191 @Interoperability, 192 @MakerNote 193 193 ].flatten 194 194 end … … 198 198 # execute given block with block argument being every tags defined 199 199 # in all the IFDs contained in the image. 200 # 200 # 201 201 # if argument ifd is specified, every tags defined in the 202 202 # specified IFD are passed to block. … … 216 216 else 217 217 [ 218 @IFD0,219 @IFD1,220 @Exif,221 @Interoperability,222 @MakerNote223 ].flatten.each do |tag| 224 yield tag218 @IfD0, 219 @IFD1, 220 @Exif, 221 @Interoperability, 222 @MakerNote 223 ].flatten.each do |tag| 224 yield tag 225 225 end 226 226 end … … 231 231 def search_tag(tagID, ifd=nil) 232 232 if ifd 233 @scanner.result(ifd).find do |tag| 234 case tagID235 when Fixnum236 tag.tagID.hex == tagID237 when String238 tag.name == tagID239 end240 end233 @scanner.result(ifd).find do |tag| 234 case tagID 235 when Fixnum 236 tag.tagID.hex == tagID 237 when String 238 tag.name == tagID 239 end 240 end 241 241 else 242 [243 @IFD0,244 @IFD1,245 @Exif,246 @GPS,247 @Interoperability,248 @MakerNote249 ].flatten.find do |tag| 250 case tagID251 when Fixnum252 tag.tagID.hex == tagID253 when String254 tag.name == tagID255 end256 end242 [ 243 @IFD0, 244 @IFD1, 245 @Exif, 246 @GPS, 247 @Interoperability, 248 @MakerNote 249 ].flatten.find do |tag| 250 case tagID 251 when Fixnum 252 tag.tagID.hex == tagID 253 when String 254 tag.name == tagID 255 end 256 end 257 257 end 258 258 end -
platform/tdiary/lib/exifparser/lib/exifparser/makernote/canon.rb
r4808 r7740 25 25 class Tag0x0001 < Base 26 26 27 def processData28 @formatted = []29 partition_data(@count) do |part|30 @formatted.push _formatData(part)31 end32 end33 34 def value35 numTags = @formatted[0] / 236 ret = {}37 38 return ret if numTags < 239 #40 # offset 1 : Macro mode41 #42 ret["Macro mode"] =43 case @formatted[1]44 when 145 "Macro"46 when 247 "Normal"48 else49 "Unknown"50 end51 52 return ret if numTags < 353 #54 # offset 2 : if nonzero, length of self-timer in 10ths of a second.55 # 56 selftimer_length = @formatted[2]57 58 return ret if numTags < 559 #60 # offset 4 : Flash mode61 #62 ret["Flash mode"] =63 case @formatted[4]64 when 065 "flash not fired"66 when 167 "auto"68 when 269 "on"70 when 371 "red-eye reduction"72 when 473 "slow synchro"74 when 575 "auto + redeye reduction"76 when 677 "on + redeye reduction"78 when 1679 "external flash"80 else81 "unknown"82 end83 84 return ret if numTags < 685 #86 # offset 5: Contiuous drive mode87 #88 ret["Continuous drive mode"] =89 case @formatted[5]90 when 091 if selftimer_length != 092 "Timer = #{selftimer_length/10.0}sec."93 else94 "Single"95 end96 when 197 "Continuous"98 end99 100 return ret if numTags < 8101 #102 # offset 7: Focus Mode103 #104 ret["Focus Mode"] =105 case @formatted[7]106 when 0107 "One-Shot"108 when 1109 "AI Servo"110 when 2111 "AI Focus"112 when 3113 "MF"114 when 4115 "Single"116 when 5117 "Continuous"118 when 6119 "MF"120 else121 "Unknown"122 end123 124 return ret if numTags < 11125 #126 # offset 10: Image size127 #128 ret["Image Size"] =129 case @formatted[10]130 when 0131 "Large"132 when 1133 "Medium"134 when135 "Small"136 else 137 "Unknown"138 end139 140 return ret if numTags < 12141 #142 # offset 11: "Easy shooting" mode143 #144 ret["Easy shooting mode"] =145 case @formatted[11]146 when 0147 "Full auto"148 when 1149 "Manual"150 when 2151 "Landscape"152 when 3153 "Fast Shutter"154 when 4155 "Slow Shutter"156 when 5157 "Night"158 when 6159 "B&W"160 when 7161 "Sepia"162 when 8163 "Portrait"164 when 9165 "Sports"166 when 10167 "Macro / Close-Up"168 when 11169 "Pan Focus"170 else171 "Unknown"172 end173 174 return ret if numTags < 14175 #176 # offset 13: Contrast177 #178 ret["Contrast"] =179 case @formatted[13]180 when 0xffff181 "Low"182 when 0x0000183 "Normal"184 when 0x0001185 "High"186 else187 "Unknown"188 end189 190 return ret if numTags < 15191 #192 # offset 14: Saturation193 #194 ret["Saturation"] =195 case @formatted[14]196 when 0xffff197 "Low"198 when 0x0000199 "Normal"200 when 0x0001201 "High"202 else203 "Unknown"204 end205 206 return ret if numTags < 16207 #208 # offset 15: Contrast209 #210 ret["Sharpness"] =211 case @formatted[15]212 when 0xffff213 "Low"214 when 0x0000215 "Normal"216 when 0x0001217 "High"218 else219 "Unknown"220 end221 222 return ret if numTags < 17223 #224 # offset 16: ISO225 #226 ret["ISO"] =227 case @formatted[16]228 when 0229 "ISOSpeedRatings"230 when 15231 "Auto"232 when 16233 50234 when 17235 100236 when 18237 200238 when 19239 400240 else241 "Unknown"242 end243 244 return ret if numTags < 18245 #246 # offset 17: Metering mode247 #248 ret['Metering mode'] =249 case @formatted[17]250 when 3251 "Evaluative"252 when 4253 "Partial"254 when 5255 "Center-weighted"256 else257 "Unknown"258 end259 ret260 end27 def processData 28 @formatted = [] 29 partition_data(@count) do |part| 30 @formatted.push _formatData(part) 31 end 32 end 33 34 def value 35 numTags = @formatted[0] / 2 36 ret = {} 37 38 return ret if numTags < 2 39 # 40 # offset 1 : Macro mode 41 # 42 ret["Macro mode"] = 43 case @formatted[1] 44 when 1 45 "Macro" 46 when 2 47 "Normal" 48 else 49 "Unknown" 50 end 51 52 return ret if numTags < 3 53 # 54 # offset 2 : if nonzero, length of self-timer in 10ths of a second. 55 # 56 selftimer_length = @formatted[2] 57 58 return ret if numTags < 5 59 # 60 # offset 4 : Flash mode 61 # 62 ret["Flash mode"] = 63 case @formatted[4] 64 when 0 65 "flash not fired" 66 when 1 67 "auto" 68 when 2 69 "on" 70 when 3 71 "red-eye reduction" 72 when 4 73 "slow synchro" 74 when 5 75 "auto + redeye reduction" 76 when 6 77 "on + redeye reduction" 78 when 16 79 "external flash" 80 else 81 "unknown" 82 end 83 84 return ret if numTags < 6 85 # 86 # offset 5: Contiuous drive mode 87 # 88 ret["Continuous drive mode"] = 89 case @formatted[5] 90 when 0 91 if selftimer_length != 0 92 "Timer = #{selftimer_length/10.0}sec." 93 else 94 "Single" 95 end 96 when 1 97 "Continuous" 98 end 99 100 return ret if numTags < 8 101 # 102 # offset 7: Focus Mode 103 # 104 ret["Focus Mode"] = 105 case @formatted[7] 106 when 0 107 "One-Shot" 108 when 1 109 "AI Servo" 110 when 2 111 "AI Focus" 112 when 3 113 "MF" 114 when 4 115 "Single" 116 when 5 117 "Continuous" 118 when 6 119 "MF" 120 else 121
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)