/usr/share/tdiary/exifparser/utils.rb is in tdiary-contrib 3.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #
# exifparser/utils.rb -
#
# Copyright (C) 2002 Ryuichi Tamura (r-tam@fsinet.or.jp)
#
# $Revision: 1.1.1.1 $
# $Date: 2002/12/16 07:59:00 $
#
module Exif
#
# utility module that will be included in some classes.
#
module Utils
module Decode
module Motorola
def byte_order
:motorola
end
def decode_ubytes(str)
str.unpack('C*')
end
def decode_ushort(str)
str[0,2].unpack('n').first
end
def decode_ulong(str)
str[0,4].unpack('N').first
end
def decode_sshort(str)
str[0,2].unpack('n').pack('s').unpack('s').first
end
def decode_slong(str)
str[0,4].unpack('N').pack('l').unpack('l').first
end
def parseTagID(str)
sprintf("0x%02x%02x", *(str.unpack("C*")))
end
end
module Intel
def byte_order
:intel
end
def decode_ubytes(str)
str.unpack('C*')
end
def decode_ushort(str)
str[0,2].unpack('v').first
end
def decode_ulong(str)
str[0,4].unpack('V').first
end
def decode_sshort(str)
str[0,2].unpack('s').first
end
def decode_slong(str)
str[0,4].unpack('l').first
end
def parseTagID(str)
"0x" + str.unpack("C*").reverse.collect{ |e| sprintf("%02x", e) }.join("")
end
end
end
end
end
|