summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/image_bundle.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/image_bundle.h
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/image_bundle.h')
-rw-r--r--third_party/jpeg-xl/lib/jxl/image_bundle.h8
1 files changed, 5 insertions, 3 deletions
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<ImageBundle> 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_, &copy.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));
}