diff --git a/.gitignore b/.gitignore index d913617..51eab7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target - +cache.properties +build diff --git a/photos/problemcases/IMG_e121.JPG b/photos/problemcases/IMG_e121.JPG new file mode 100644 index 0000000..eabc0a2 Binary files /dev/null and b/photos/problemcases/IMG_e121.JPG differ diff --git a/src/org/forkalsrud/album/web/PictureScaler.java b/src/org/forkalsrud/album/web/PictureScaler.java index dbeed20..5cd0c97 100644 --- a/src/org/forkalsrud/album/web/PictureScaler.java +++ b/src/org/forkalsrud/album/web/PictureScaler.java @@ -92,7 +92,7 @@ public class PictureScaler { this.future = future; } - public CachedImage waitForIt(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { + public CachedImage waitForIt(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException { return future.get(/*timeout, unit*/); } @@ -113,15 +113,15 @@ public class PictureScaler { } - public CachedImage scalePicture(File file, Thumbnail thumbnail, String size) throws TimeoutException { + public CachedImage scalePicture(File file, Thumbnail thumbnail, String size) { PictureRequest req = getPictureRequest(file, thumbnail, size); try { return req.waitForIt(30, TimeUnit.SECONDS); - } catch (TimeoutException toe) { - req.cancel(); - toe.printStackTrace(); - throw new TimeoutException("timed out"); +// } catch (TimeoutException toe) { +// req.cancel(); +// toe.printStackTrace(); +// throw new TimeoutException("timed out"); } catch (InterruptedException e) { e.printStackTrace(); return null; @@ -186,6 +186,8 @@ public class PictureScaler { // // The first four are obtained with only flipping X and/or Y // The last four are obtained by rotating 90 degrees and then flipping X and/or Y. + // + // TODO: Flipping here completely forgets to translate accordingly, so for example rotation id 3 becomes completely messed up. double[] flipX = new double[] { +1, -1, -1, +1, -1, +1, +1, -1 }; double[] flipY = new double[] { +1, +1, -1, -1, +1, +1, -1, -1 };