Class: Exif::Tag::Exif::UserComment

Inherits:
Base
  • Object
show all
Defined in:
lib/exifparser/tag.rb

Overview

0x9286 - UserComment

Instance Attribute Summary

Attributes inherited from Base

#IFD, #count, #data, #dataPos, #pos, #tagID

Instance Method Summary collapse

Methods inherited from Base

#formatExposureTime, #formatFNumber, #formatFocalLength, #formatLatLon, #initialize, #inspect, #name, #processData, #value

Constructor Details

This class inherits a constructor from Exif::Tag::Base

Instance Method Details

#to_sObject



1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/exifparser/tag.rb', line 1211

def to_s
  case @data[0..7]
  # ASCII
  when [0x41,0x53,0x43,0x49,0x49,0x0,0x0,0x0]
    @data[8..-1].pack("C*")
  # JIS
  when [0x4a,0x59,0x53,0x0,0x0,0x0,0x0,0x0]
    @data[8..-1].pack("C*")
  # Unicode
  when [0x55,0x4e,0x49,0x43,0x4f,0x44,0x45,0x0]
    @data[8..-1].pack("U*")
  when [0x0]*8
    @data[8..-1].pack("C*")
  else
    "unknown"
  end
end