From 9e00434a2f9e146dcce2faff210803de71b39fa5 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 26 Jun 2006 12:34:40 +0000 Subject: [PATCH] clarify that FORMATGUESS is only used when writing to a file. http://rt.cpan.org/Ticket/Display.html?id=18773 --- lib/Imager/Files.pod | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/Imager/Files.pod b/lib/Imager/Files.pod index bf641924..938ccabf 100644 --- a/lib/Imager/Files.pod +++ b/lib/Imager/Files.pod @@ -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. The code reference is -called with a single parameter, the filename of the file. The code -reference is only called if a C parameter is supplied to the -file access method. +When writing to a file, if you don't supply a C 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 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 -- 2.39.5