示例#1
0
 /**
  * Verifies that the image's info can be read correctly.
  * If the src image fails, it tries the error image as the fallback.
  *
  * @param Transaction $transaction
  *
  * @throws RuntimeException If both src and error images fail to be read.
  */
 protected function verifyInfo(Transaction $transaction)
 {
     try {
         $transaction->getSrcImage()->getInfo();
         return;
     } catch (IOException $e) {
     }
     $transaction->setSrcImage($transaction->getErrorImage());
     try {
         $transaction->getSrcImage()->getInfo();
     } catch (IOException $e) {
         throw new RuntimeException('There was an error with the thumbnail image requested and additionally the fallback image could not be displayed.', 1, $e);
     }
 }