]> git.imager.perl.org - imager.git/commitdiff
clarify that FORMATGUESS is only used when writing to a file.
authorTony Cook <tony@develop=help.com>
Mon, 26 Jun 2006 12:34:40 +0000 (12:34 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 26 Jun 2006 12:34:40 +0000 (12:34 +0000)
  http://rt.cpan.org/Ticket/Display.html?id=18773

lib/Imager/Files.pod

index bf641924030f3abac04fb1388f2fe59d1a1a40fc..938ccabf16f89db2464da3b384638f02ab49d68e 100644 (file)
@@ -170,17 +170,32 @@ buffered data.
 
 =head2 Guessing types
 
-Imager uses the code reference in $Imager::FORMATGUESS to guess the
-file type when you don't supply a C<type>.  The code reference is
-called with a single parameter, the filename of the file.  The code
-reference is only called if a C<file> parameter is supplied to the
-file access method.
+When writing to a file, if you don't supply a C<type> parameter Imager
+will attempt to guess it from the filename.  This is done by calling
+the code reference stored in C<$Imager::FORMATGUESS>.  This is only
+done when write() or write_multi() is called with a C<file> parameter.
 
-Return either a valid Imager file type, or undef.
+The default function examines the extension of the filename to guess
+the type.
+
+You can replace function with your own implementation if you have some
+specialized need.  The function takes a single parameter, the name of
+the file, and should return either a file type or under.
 
   # I'm writing jpegs to weird filenames
   local $Imager::FORMATGUESS = sub { 'jpeg' };
 
+When reading a file Imager examines beginning of the file for
+identifying information.  The current implementation attempts to
+detect the following image types beyond those supported by Imager:
+
+=over
+
+xpm, mng, jng, SGI RGB, ilbm, pcx, fits, psd (Photoshop), eps, Utah
+RLE
+
+=back
+
 =head2 Limiting the sizes of images you read
 
 =over