/usr/lib/perl5/Image/EXIF.pm is in libimage-exif-perl 1.00.3-4build2.
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | package Image::EXIF;
use 5.006;
use strict;
use warnings;
use Carp;
require Exporter;
require DynaLoader;
use AutoLoader;
use Data::Dumper;
our @ISA = qw(Exporter DynaLoader);
sub get_image_info($);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# This allows declaration use Image::EXIF ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw();
our $VERSION = '1.00.3';
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
# XS function. If a constant is not found then control is passed
# to the AUTOLOAD in AutoLoader.
my $constname;
our $AUTOLOAD;
($constname = $AUTOLOAD) =~ s/.*:://;
croak "& not defined" if $constname eq 'constant';
my $val = constant($constname, @_ ? $_[0] : 0);
if ($! != 0) {
if ($! =~ /Invalid/ || $!{EINVAL}) {
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD;
}
else {
croak "Your vendor has not defined Image::EXIF macro $constname";
}
}
{
no strict 'refs';
# Fixed between 5.005_53 and 5.005_61
if ($] >= 5.00561) {
*$AUTOLOAD = sub () { $val };
}
else {
*$AUTOLOAD = sub { $val };
}
}
goto &$AUTOLOAD;
}
bootstrap Image::EXIF $VERSION;
# Preloaded methods go here.
# Autoload methods go after =cut, and are processed by the autosplit program.
sub new
{
my ($class, $file_name) = @_;
my $self = {};
bless $self, $class;
$self->file_name($file_name) if ($file_name && $file_name ne '');
$self->{errstr} = [()];
$self;
}
sub file_name($;$)
{
my $self = shift;
if (@_){
my $tmp = shift || '';
$self->{file_name} = $tmp if ($tmp ne '');
}
if ($self->{file_name} && $self->{file_name} ne '' ){
c_read_file($self->{file_name});
} else {
push @{$self->{errstr}}, 'Please set file_name';
}
$self->{file_name};
}
sub error($)
{
my $self = shift;
@{$self->{errstr}};
}
sub errstr($)
{
my $self = shift;
shift @{$self->{errstr}};
}
sub get_camera_info($)
{
my $self = shift;
my $hash;
if (c_errstr()){
push @{$self->{errstr}}, c_errstr();
} else {
c_get_camera_info();
while(my ($fld, $val) = c_fetch()){
$val =~ s/\s*$//g;
$fld eq '' && next;
$hash->{$fld} = $val;
}
}
$hash;
}
sub get_image_info($)
{
my $self = shift;
my $hash;
if (c_errstr()){
push @{$self->{errstr}}, c_errstr();
} else {
c_get_image_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{$fld} = $val;
}
}
$hash;
}
sub get_other_info($)
{
my $self = shift;
my $hash;
if (c_errstr()){
push @{$self->{errstr}}, c_errstr();
} else {
c_get_other_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{$fld} = $val;
}
}
$hash;
}
sub get_unknown_info($)
{
my $self = shift;
my $hash;
if (c_errstr()){
push @{$self->{errstr}}, c_errstr();
} else {
c_get_unknown_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{$fld} = $val;
}
}
$hash;
}
sub get_all_info($)
{
my $self = shift;
my $hash;
if (c_errstr()){
push @{$self->{errstr}}, c_errstr();
return;
} else {
c_get_camera_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{camera}->{$fld} = $val;
}
c_get_image_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{image}->{$fld} = $val;
}
c_get_other_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{other}->{$fld} = $val;
}
c_get_unknown_info();
while(my ($fld, $val) = c_fetch()){
$fld eq '' && next;
$val =~ s/\s*$//g;
$hash->{unknown}->{$fld} = $val;
}
}
$hash;
}
sub DESTROY
{
c_close_all();
}
1;
__END__
=head1 NAME
Image::EXIF - Perl extension for exif library
=head1 SYNOPSIS
use Image::EXIF;
use Data::Dumper;
my $exif = new Image::EXIF($file_name);
or
my $exif = new Image::EXIF;
$exif->file_name($file_name);
my $image_info = $exif->get_image_info(); # hash reference
my $camera_info = $exif->get_camera_info(); # hash reference
my $other_info = $exif->get_other_info(); # hash reference
my $point_shoot_info = $exif->get_point_shoot_info(); # hash reference
my $unknown_info = $exif->get_unknown_info(); # hash reference
my $all_info = $exif->get_all_info(); # hash reference
print $exif->error ?
$exif->errstr : Dumper($all_info);
=head1 DESCRIPTION
Perl Package Image::EXIF based on utility exiftags v0.99.1
by Eric M. Johnston, emj@postal.net, http://johnst.org/sw/exiftags/.
Actually it's just a wrapper. Weak PHP's support of EXIF
made me write it.
If you wanna improve it - go ahead. I did this module only
because nobody did it before.
=head2 EXPORT
Nothing.
=head1 AUTHOR
sergey s prozhogin<lt>ccpro@rrelaxo.org.ru<gt>
=head1 SEE ALSO
L<exiftags>.
=cut
|