From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/jpeg-xl/lib/jxl/image_bundle.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'third_party/jpeg-xl/lib/jxl/image_bundle.h') diff --git a/third_party/jpeg-xl/lib/jxl/image_bundle.h b/third_party/jpeg-xl/lib/jxl/image_bundle.h index 2eea496d5e..c8a76a9f59 100644 --- a/third_party/jpeg-xl/lib/jxl/image_bundle.h +++ b/third_party/jpeg-xl/lib/jxl/image_bundle.h @@ -42,14 +42,16 @@ class ImageBundle { ImageBundle(ImageBundle&&) = default; ImageBundle& operator=(ImageBundle&&) = default; - ImageBundle Copy() const { + StatusOr Copy() const { ImageBundle copy(metadata_); - copy.color_ = Image3F(color_.xsize(), color_.ysize()); + JXL_ASSIGN_OR_RETURN(copy.color_, + Image3F::Create(color_.xsize(), color_.ysize())); CopyImageTo(color_, ©.color_); copy.c_current_ = c_current_; copy.extra_channels_.reserve(extra_channels_.size()); for (const ImageF& plane : extra_channels_) { - ImageF ec(plane.xsize(), plane.ysize()); + JXL_ASSIGN_OR_RETURN(ImageF ec, + ImageF::Create(plane.xsize(), plane.ysize())); CopyImageTo(plane, &ec); copy.extra_channels_.emplace_back(std::move(ec)); } -- cgit v1.2.3