Fix EXRHandler::canRead not identifying exr files
author Aurélien Gâteau
()
committer Aurélien Gâteau
()
commit e0750fc3276f7ac31f8c832c0cee402713c4a536
tree 5cfbb95b55f3f8b9e821a63ec3dbb4d55de96bac
parent e7a187d56d0553a7f13d2f08f7a44a4ea848fbfe
Fix EXRHandler::canRead not identifying exr files

QIODevice::readLine(int maxSize) returns at most an array of maxSize-1
byte + a terminating \0 byte. Calling readLine(4) thus returns a 3 char
ASCII string. This is too short for Imf::isImfMagic, which expects a 4 byte
array.

Taking some cue from jp2.cpp, I also simplified the code to use
QIODevice::peek().

CCMAIL: Brad Hards <bradh@frogmouth.net>
kimgio/exr.cpp