bump versions of sub-modules that have been updated
[imager.git] / JPEG / JPEG.pm
CommitLineData
797a9f9c
TC
1package Imager::File::JPEG;
2use strict;
3use Imager;
4use vars qw($VERSION @ISA);
5
6BEGIN {
deddc246 7 $VERSION = "0.85";
797a9f9c 8
a5919365
TC
9 require XSLoader;
10 XSLoader::load('Imager::File::JPEG', $VERSION);
797a9f9c
TC
11}
12
13Imager->register_reader
14 (
15 type=>'jpeg',
4b2e59d3 16 single =>
797a9f9c
TC
17 sub {
18 my ($im, $io, %hsh) = @_;
19
20 ($im->{IMG},$im->{IPTCRAW}) = i_readjpeg_wiol( $io );
21
22 unless ($im->{IMG}) {
23 $im->_set_error(Imager->_error_as_msg);
24 return;
25 }
26 return $im;
27 },
28 );
29
30Imager->register_writer
31 (
32 type=>'jpeg',
33 single =>
34 sub {
35 my ($im, $io, %hsh) = @_;
36
37 $im->_set_opts(\%hsh, "i_", $im);
38 $im->_set_opts(\%hsh, "jpeg_", $im);
39 $im->_set_opts(\%hsh, "exif_", $im);
40
41 my $quality = $hsh{jpegquality};
42 defined $quality or $quality = 75;
43
44 if ( !i_writejpeg_wiol($im->{IMG}, $io, $quality)) {
45 $im->_set_error(Imager->_error_as_msg);
46 return;
47 }
48
49 return $im;
50 },
51 );
52
53__END__
54
55=head1 NAME
56
57Imager::File::JPEG - read and write JPEG files
58
59=head1 SYNOPSIS
60
61 use Imager;
62
63 my $img = Imager->new;
64 $img->read(file=>"foo.jpg")
65 or die $img->errstr;
66
67 $img->write(file => "foo.jpg")
68 or die $img->errstr;
69
70=head1 DESCRIPTION
71
72Imager's JPEG support is documented in L<Imager::Files>.
73
74=head1 AUTHOR
75
5b480b14 76Tony Cook <tonyc@cpan.org>
797a9f9c
TC
77
78=head1 SEE ALSO
79
80Imager, Imager::Files.
81
82=cut