Improvement to Shift_JIS encoding detector to avoid detecting some UTF-8 strings...
[zxing.git] / core / test / src / com / google / zxing / qrcode / QRCodeWriterTestCase.java
index c50b7da..c63b375 100644 (file)
@@ -41,6 +41,10 @@ public final class QRCodeWriterTestCase extends TestCase {
   private static BufferedImage loadImage(String fileName) {
     try {
       File file = new File(BASE_IMAGE_PATH + fileName);
+      if (!file.exists()) {
+        // try starting with 'core' since the test base is often given as the project root
+        file = new File("core/" + BASE_IMAGE_PATH + fileName);
+      }
       assertTrue("Please run from the 'core' directory", file.exists());
       return ImageIO.read(file);
     } catch (IOException e) {