summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-09 14:05:46 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-09 14:05:46 +0100
commit87cdcd69f035f0388358bb9e3e5a15b997ccce50 (patch)
tree6367dcb6157be812101a35b655ee0d177dda5b25 /src
parentb7ee27b7a5eea307552cd1afa505da5cc701a041 (diff)
Fix up image sizes when direct-reducing JPEG2000.
Diffstat (limited to 'src')
-rw-r--r--src/util.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index 4434b98c..ad6a66fe 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -175,6 +175,9 @@ libdcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
}
opj_cio_close (cio);
+
+ image->x1 /= pow (2, reduce);
+ image->y1 /= pow (2, reduce);
return image;
}
@@ -194,13 +197,13 @@ libdcp::xyz_to_rgb (opj_image_t* xyz_frame)
int* xyz_z = xyz_frame->comps[2].data;
shared_ptr<ARGBFrame> argb_frame (new ARGBFrame (xyz_frame->x1, xyz_frame->y1));
-
+
uint8_t* argb = argb_frame->data ();
for (int y = 0; y < xyz_frame->y1; ++y) {
uint8_t* argb_line = argb;
for (int x = 0; x < xyz_frame->x1; ++x) {
-
+
assert (*xyz_x >= 0 && *xyz_y >= 0 && *xyz_z >= 0 && *xyz_x < 4096 && *xyz_x < 4096 && *xyz_z < 4096);
/* In gamma LUT */