GD

 view release on metacpan or  search on metacpan

lib/GD/Image_pm.PL  view on Meta::CPAN

=over 4

!NO!SUBS!

print OUT "=item Png\n\n" if $DEFINES =~ /HAVE_PNG/;
print OUT "=item Gif\n\n" if $DEFINES =~ /HAVE_GIF/;
print OUT "=item Gd\n\n=item Gd2\n\n" if $DEFINES =~ /HAVE_GD2/;
print OUT "=item Jpeg\n\n" if $DEFINES =~ /HAVE_JPEG/;
print OUT "=item Tiff\n\n" if $DEFINES =~ /HAVE_TIFF/;
print OUT "=item Xpm\n\n" if $DEFINES =~ /HAVE_XPM/;
print OUT "=item Xbm\n\n";
print OUT "=item WBMP\n\n";
print OUT "=item BMP\n\n" if $DEFINES =~ /HAVE_BMP/;
print OUT "=item GifAnim\n\n" if $DEFINES =~ /HAVE_GIFANIM/;
print OUT "=item Webp\n\n" if $DEFINES =~ /HAVE_WEBP/;
print OUT "=item Heif\n\n" if $DEFINES =~ /HAVE_HEIF/;
print OUT "=item Avif\n\n" if $DEFINES =~ /HAVE_AVIF/;

print OUT << '!NO!SUBS!';
=back

Unsupported Image formats:

=over 4

!NO!SUBS!

print OUT "=item Png\n\n" if $DEFINES !~ /HAVE_PNG/;
print OUT "=item Gif\n\n" if $DEFINES !~ /HAVE_GIF/;
print OUT "=item Gd\n\n=item Gd2\n\n" if $DEFINES !~ /HAVE_GD2/;
print OUT "=item Jpeg\n\n" if $DEFINES !~ /HAVE_JPEG/;
print OUT "=item Tiff\n\n" if $DEFINES !~ /HAVE_TIFF/;
print OUT "=item Xpm\n\n" if $DEFINES !~ /HAVE_XPM/;
print OUT "=item GifAnim\n\n" if $DEFINES !~ /HAVE_GIFANIM/;
print OUT "=item Webp\n\n" if $DEFINES !~ /HAVE_WEBP/;
print OUT "=item Heif\n\n" if $DEFINES !~ /HAVE_HEIF/;
print OUT "=item Avif\n\n" if $DEFINES !~ /HAVE_AVIF/;
print OUT "=item BMP\n\n" if $DEFINES !~ /HAVE_BMP/;

print OUT << '!NO!SUBS!';
=back

See L<GD>

=head1 AUTHOR

The GD.pm interface is copyright 1995-2005, Lincoln D. Stein.  It is
distributed under the same terms as Perl itself.  See the "Artistic
License" in the Perl source code distribution for licensing terms.

The latest versions of GD.pm are available on CPAN:

  http://www.cpan.org

=head1 SEE ALSO

L<GD>
L<GD::Polyline>,
L<GD::SVG>,
L<GD::Simple>,
L<Image::Magick>

=cut

# Copyright 1995 Lincoln D. Stein.  See accompanying README file for
# usage information

*stringTTF = \&GD::Image::stringFT;

sub _make_filehandle {
  shift;  # get rid of class
  no strict 'refs';
  my $thing = shift;
  return $thing if defined(fileno $thing);

  # otherwise try qualifying it into caller's package
  my $fh;
  {   
    local $^W = 0;  # to avoid uninitialized variable warning from Symbol.pm
    my $pkg = caller(2);
    $pkg = "main" unless defined $pkg;;
    $fh = qualify_to_ref($thing,$pkg);
  }
  return $fh if defined(fileno $fh);

  # otherwise treat it as a file to open
  $fh = gensym;
  if (!open($fh,$thing)) {
    die "$thing not found: $!";
    return undef;
  }
  return $fh;
}

sub new {
  my $pack = shift;
  if (@_ == 1) {
    if (my $type = _image_type($_[0])) {
      my $method = "newFrom${type}Data";
      return unless $pack->can($method);
      return $pack->$method($_[0]);
    } elsif (-f $_[0] and $_[0] =~ /\.gd$/) {
      my $type = 'Gd';
      return unless my $fh = $pack->_make_filehandle($_[0]);
      my $method = "newFrom${type}";
      return unless $pack->can($method);
      return $pack->$method($fh);
    } elsif (-f $_[0] and $_[0] =~ /\.gd2$/) {
      my $type = 'Gd2';
      return unless my $fh = $pack->_make_filehandle($_[0]);
      my $method = "newFrom${type}";
      return unless $pack->can($method);
      return $pack->$method($fh);
    } elsif (-f $_[0] and $_[0] =~ /\.wbmp$/) {
      my $type = 'WBMP';
      return unless my $fh = $pack->_make_filehandle($_[0]);
      my $method = "newFrom${type}";
      return unless $pack->can($method);
      return $pack->$method($fh);
    } elsif (-f $_[0] and $_[0] =~ /\.xpm$/) {
      my $type = 'Xpm';



( run in 0.622 second using v1.01-cache-2.11-cpan-39bf76dae61 )