File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ struct LoadedImage {
20
20
Optional<ReadonlyBytes> icc_data;
21
21
};
22
22
23
+ static ErrorOr<LoadedImage> load_image (RefPtr<Gfx::ImageDecoder> const & decoder, int frame_index)
24
+ {
25
+ return LoadedImage { TRY (decoder->frame (frame_index)).image , TRY (decoder->icc_data ()) };
26
+ }
27
+
23
28
static ErrorOr<void > do_move_alpha_to_rgb (LoadedImage& image)
24
29
{
25
30
auto frame = image.bitmap ;
@@ -151,7 +156,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
151
156
if (!decoder)
152
157
return Error::from_string_view (" Failed to decode input file" sv);
153
158
154
- LoadedImage image = { TRY (decoder-> frame (frame_index)). image , TRY (decoder-> icc_data ()) } ;
159
+ LoadedImage image = TRY (load_image (*decoder, frame_index)) ;
155
160
156
161
if (move_alpha_to_rgb)
157
162
TRY (do_move_alpha_to_rgb (image));
You can’t perform that action at this time.
0 commit comments