summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc')
-rw-r--r--third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc b/third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc
index c2ccf56175..39df4bd473 100644
--- a/third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc
+++ b/third_party/jpeg-xl/lib/jxl/butteraugli/butteraugli_test.cc
@@ -30,7 +30,7 @@ using extras::PackedPixelFile;
using test::TestImage;
Image3F SinglePixelImage(float red, float green, float blue) {
- Image3F img(1, 1);
+ JXL_ASSIGN_OR_DIE(Image3F img, Image3F::Create(1, 1));
img.PlaneRow(0, 0)[0] = red;
img.PlaneRow(1, 0)[0] = green;
img.PlaneRow(2, 0)[0] = blue;
@@ -42,7 +42,7 @@ Image3F GetColorImage(const PackedPixelFile& ppf) {
const PackedImage& image = ppf.frames[0].color;
const JxlPixelFormat& format = image.format;
const uint8_t* pixels = reinterpret_cast<const uint8_t*>(image.pixels());
- Image3F color(image.xsize, image.ysize);
+ JXL_ASSIGN_OR_DIE(Image3F color, Image3F::Create(image.xsize, image.ysize));
for (size_t c = 0; c < format.num_channels; ++c) {
JXL_CHECK(ConvertFromExternal(pixels, image.pixels_size, image.xsize,
image.ysize, ppf.info.bits_per_sample, format,
@@ -93,7 +93,7 @@ TEST(ButteraugliInPlaceTest, LargeImage) {
TestImage img;
img.SetDimensions(xsize, ysize).AddFrame().RandomFill(777);
Image3F rgb0 = GetColorImage(img.ppf());
- Image3F rgb1(xsize, ysize);
+ JXL_ASSIGN_OR_DIE(Image3F rgb1, Image3F::Create(xsize, ysize));
CopyImageTo(rgb0, &rgb1);
AddUniformNoise(&rgb1, 0.02f, 7777);
AddEdge(&rgb1, 0.1f, xsize / 2, xsize / 2);