This file is indexed.

/usr/share/tdiary/exifparser/thumbnail.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
#
#  exifparser/thumbnail.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

  class Parser

    alias orig_thumbnail thumbnail

    #
    # redefine method.
    #
    def thumbnail
      Thumbnail.new(@result[:IFD1], @data)
    end

  end

  #
  # APIs are subject to change.
  #
  class Thumbnail

    def initialize(ifd1, data)
      @ifd1 = ifd1
      @data = data
    end

    def size
      @data.size
    end

    def write(dest)
      dest << @data
    end

    def width
      search_tag('ImageWidth')
    end

    def height
      search_tag('ImageLength')
    end
    alias length height

    def bits_per_sample
      search_tag('BitsPerSample')
    end

    def compression
      search_tag('Compression')
    end

    def photometric_interpretation
      search_tag('PhotometricInterpretation')
    end

    def strip_offsets
      search_tag('StripOffsets')
    end

    private

    def search_tag(tag)
      @ifd1.find { |t| t.name == tag }
    end

  end

end