/usr/share/perl5/Image/ExifTool/Radiance.pm is in libimage-exiftool-perl 9.74-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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | #------------------------------------------------------------------------------
# File: Radiance.pm
#
# Description: Read Radiance RGBE HDR meta information
#
# Revisions: 2011/12/10 - P. Harvey Created
#
# References: 1) http://www.graphics.cornell.edu/online/formats/rgbe/
# 2) http://radsite.lbl.gov/radiance/refer/filefmts.pdf
#------------------------------------------------------------------------------
package Image::ExifTool::Radiance;
use strict;
use vars qw($VERSION);
use Image::ExifTool qw(:DataAccess :Utils);
$VERSION = '1.01';
# Radiance tags
%Image::ExifTool::Radiance::Main = (
GROUPS => { 2 => 'Image' },
NOTES => q{
Information extracted from Radiance RGBE HDR images. Tag ID's are all
uppercase as stored in the file, but converted to lowercase by when
extracting to avoid conflicts with internal ExifTool variables. See
L<http://radsite.lbl.gov/radiance/refer/filefmts.pdf> and
L<http://www.graphics.cornell.edu/online/formats/rgbe/> for the
specification.
},
_orient => {
Name => 'Orientation',
PrintConv => {
'-Y +X' => 'Horizontal (normal)',
'-Y -X' => 'Mirror horizontal',
'+Y -X' => 'Rotate 180',
'+Y +X' => 'Mirror vertical',
'+X -Y' => 'Mirror horizontal and rotate 270 CW',
'+X +Y' => 'Rotate 90 CW',
'-X +Y' => 'Mirror horizontal and rotate 90 CW',
'-X -Y' => 'Rotate 270 CW',
},
},
_command => 'Command',
software => 'Software',
view => 'View',
'format' => 'Format', # <-- this is the one that caused the conflict when uppercase
exposure => {
Name => 'Exposure',
Notes => 'divide pixel values by this to get watts/steradian/meter^2',
},
gamma => 'Gamma',
colorcorr => 'ColorCorrection',
pixaspect => 'PixelAspectRatio',
primaries => 'ColorPrimaries',
);
#------------------------------------------------------------------------------
# Extract information from a Radiance JDR file
# Inputs: 0) ExifTool object reference, 1) DirInfo reference
# Returns: 1 on success, 0 if this wasn't a valid RGBE image
sub ProcessHDR($$)
{
my ($et, $dirInfo) = @_;
my $raf = $$dirInfo{RAF};
my $buff;
local $/ = "\x0a"; # set newline character for reading
# verify this is a valid RIFF file
return 0 unless $raf->ReadLine($buff) and $buff =~ /^#\?(RADIANCE|RGBE)\x0a/s;
$et->SetFileType();
my $tagTablePtr = GetTagTable('Image::ExifTool::Radiance::Main');
while ($raf->ReadLine($buff)) {
chomp $buff;
last unless length($buff) > 0 and length($buff) < 4096;
unless ($buff =~ /^(.*)?\s*=\s*(.*)/) {
$et->HandleTag($tagTablePtr, '_command', $buff);
next;
}
# use lower-case tag names to avoid conflicts with reserved tag table entries
my ($tag, $val) = (lc $1, $2);
my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
unless ($tagInfo) {
my $name = $tag;
$name =~ tr/-_a-zA-Z0-9//dc;
next unless length($name) > 1;
$name = ucfirst $name;
$tagInfo = { Name => $name };
AddTagToTable($tagTablePtr, $tag, $tagInfo);
}
$et->FoundTag($tagInfo, $val);
}
# get image dimensions
if ($raf->ReadLine($buff) and $buff =~ /([-+][XY])\s*(\d+)\s*([-+][XY])\s*(\d+)/) {
$et->HandleTag($tagTablePtr, '_orient', "$1 $3");
$et->FoundTag('ImageHeight', $2);
$et->FoundTag('ImageWidth', $4);
}
return 1;
}
1; # end
__END__
=head1 NAME
Image::ExifTool::Radiance - Read Radiance RGBE HDR meta information
=head1 SYNOPSIS
This module is used by Image::ExifTool
=head1 DESCRIPTION
This module contains definitions required by Image::ExifTool to extract meta
information from Radiance RGBE images. RGBE (Red Green Blue Exponent)
images are a type of high dynamic-range image.
=head1 AUTHOR
Copyright 2003-2014, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 REFERENCES
=over 4
=item L<http://radsite.lbl.gov/radiance/refer/filefmts.pdf>
=item L<http://www.graphics.cornell.edu/online/formats/rgbe/>
=back
=head1 SEE ALSO
L<Image::ExifTool::TagNames/Radiance Tags>,
L<Image::ExifTool(3pm)|Image::ExifTool>
=cut
|