Subject: | diagnostic message: "not possible to guess from extension" is not accurate for read() calls |
The following diagnostic message is used for both calls to read() and
write():
"not possible to guess from extension"
However, it is only accurate for read() calls. For calls to read(),
extensions are not considered at all, but instead the "magic numbers" in
the header are checked.
The documentation agrees about this:
http://search.cpan.org/~tonyc/Imager-
0.86/lib/Imager/Files.pod#Guessing_types
As does the code. For calls to read(), it would be more accurate to say
"not possible to guess from the header" or "not possible to guess from
the magic number".
This may seem like a small thing, but in my case today the accuracy of
the diagnostic message was rather important. Before getting to Imager,
my input passed through a temp file and lost it's extension. The
diagnostic message led me to believe the lack of extension on the
incoming temp file may have been the issue, but in fact it was a corrupt
image with an invalid "magic number".
Thanks again for Imager. We happy to replacing Image::Magick with this.