/src/libjpeg-turbo.main/jdapimin.c
Line  | Count  | Source (jump to first uncovered line)  | 
1  |  | /*  | 
2  |  |  * jdapimin.c  | 
3  |  |  *  | 
4  |  |  * This file was part of the Independent JPEG Group's software:  | 
5  |  |  * Copyright (C) 1994-1998, Thomas G. Lane.  | 
6  |  |  * libjpeg-turbo Modifications:  | 
7  |  |  * Copyright (C) 2016, 2022, D. R. Commander.  | 
8  |  |  * For conditions of distribution and use, see the accompanying README.ijg  | 
9  |  |  * file.  | 
10  |  |  *  | 
11  |  |  * This file contains application interface code for the decompression half  | 
12  |  |  * of the JPEG library.  These are the "minimum" API routines that may be  | 
13  |  |  * needed in either the normal full-decompression case or the  | 
14  |  |  * transcoding-only case.  | 
15  |  |  *  | 
16  |  |  * Most of the routines intended to be called directly by an application  | 
17  |  |  * are in this file or in jdapistd.c.  But also see jcomapi.c for routines  | 
18  |  |  * shared by compression and decompression, and jdtrans.c for the transcoding  | 
19  |  |  * case.  | 
20  |  |  */  | 
21  |  |  | 
22  |  | #define JPEG_INTERNALS  | 
23  |  | #include "jinclude.h"  | 
24  |  | #include "jpeglib.h"  | 
25  |  | #include "jdmaster.h"  | 
26  |  |  | 
27  |  |  | 
28  |  | /*  | 
29  |  |  * Initialization of a JPEG decompression object.  | 
30  |  |  * The error manager must already be set up (in case memory manager fails).  | 
31  |  |  */  | 
32  |  |  | 
33  |  | GLOBAL(void)  | 
34  |  | jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize)  | 
35  | 11.8k  | { | 
36  | 11.8k  |   int i;  | 
37  |  |  | 
38  |  |   /* Guard against version mismatches between library and caller. */  | 
39  | 11.8k  |   cinfo->mem = NULL;            /* so jpeg_destroy knows mem mgr not called */  | 
40  | 11.8k  |   if (version != JPEG_LIB_VERSION)  | 
41  | 0  |     ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);  | 
42  | 11.8k  |   if (structsize != sizeof(struct jpeg_decompress_struct))  | 
43  | 0  |     ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,  | 
44  | 11.8k  |              (int)sizeof(struct jpeg_decompress_struct), (int)structsize);  | 
45  |  |  | 
46  |  |   /* For debugging purposes, we zero the whole master structure.  | 
47  |  |    * But the application has already set the err pointer, and may have set  | 
48  |  |    * client_data, so we have to save and restore those fields.  | 
49  |  |    * Note: if application hasn't set client_data, tools like Purify may  | 
50  |  |    * complain here.  | 
51  |  |    */  | 
52  | 11.8k  |   { | 
53  | 11.8k  |     struct jpeg_error_mgr *err = cinfo->err;  | 
54  | 11.8k  |     void *client_data = cinfo->client_data; /* ignore Purify complaint here */  | 
55  | 11.8k  |     memset(cinfo, 0, sizeof(struct jpeg_decompress_struct));  | 
56  | 11.8k  |     cinfo->err = err;  | 
57  | 11.8k  |     cinfo->client_data = client_data;  | 
58  | 11.8k  |   }  | 
59  | 11.8k  |   cinfo->is_decompressor = TRUE;  | 
60  |  |  | 
61  |  |   /* Initialize a memory manager instance for this object */  | 
62  | 11.8k  |   jinit_memory_mgr((j_common_ptr)cinfo);  | 
63  |  |  | 
64  |  |   /* Zero out pointers to permanent structures. */  | 
65  | 11.8k  |   cinfo->progress = NULL;  | 
66  | 11.8k  |   cinfo->src = NULL;  | 
67  |  |  | 
68  | 59.4k  |   for (i = 0; i < NUM_QUANT_TBLS; i++)  | 
69  | 47.5k  |     cinfo->quant_tbl_ptrs[i] = NULL;  | 
70  |  |  | 
71  | 59.4k  |   for (i = 0; i < NUM_HUFF_TBLS; i++) { | 
72  | 47.5k  |     cinfo->dc_huff_tbl_ptrs[i] = NULL;  | 
73  | 47.5k  |     cinfo->ac_huff_tbl_ptrs[i] = NULL;  | 
74  | 47.5k  |   }  | 
75  |  |  | 
76  |  |   /* Initialize marker processor so application can override methods  | 
77  |  |    * for COM, APPn markers before calling jpeg_read_header.  | 
78  |  |    */  | 
79  | 11.8k  |   cinfo->marker_list = NULL;  | 
80  | 11.8k  |   jinit_marker_reader(cinfo);  | 
81  |  |  | 
82  |  |   /* And initialize the overall input controller. */  | 
83  | 11.8k  |   jinit_input_controller(cinfo);  | 
84  |  |  | 
85  |  |   /* OK, I'm ready */  | 
86  | 11.8k  |   cinfo->global_state = DSTATE_START;  | 
87  |  |  | 
88  |  |   /* The master struct is used to store extension parameters, so we allocate it  | 
89  |  |    * here.  | 
90  |  |    */  | 
91  | 11.8k  |   cinfo->master = (struct jpeg_decomp_master *)  | 
92  | 11.8k  |     (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,  | 
93  | 11.8k  |                                 sizeof(my_decomp_master));  | 
94  | 11.8k  |   memset(cinfo->master, 0, sizeof(my_decomp_master));  | 
95  | 11.8k  | }  | 
96  |  |  | 
97  |  |  | 
98  |  | /*  | 
99  |  |  * Destruction of a JPEG decompression object  | 
100  |  |  */  | 
101  |  |  | 
102  |  | GLOBAL(void)  | 
103  |  | jpeg_destroy_decompress(j_decompress_ptr cinfo)  | 
104  | 11.8k  | { | 
105  | 11.8k  |   jpeg_destroy((j_common_ptr)cinfo); /* use common routine */  | 
106  | 11.8k  | }  | 
107  |  |  | 
108  |  |  | 
109  |  | /*  | 
110  |  |  * Abort processing of a JPEG decompression operation,  | 
111  |  |  * but don't destroy the object itself.  | 
112  |  |  */  | 
113  |  |  | 
114  |  | GLOBAL(void)  | 
115  |  | jpeg_abort_decompress(j_decompress_ptr cinfo)  | 
116  | 37.4k  | { | 
117  | 37.4k  |   jpeg_abort((j_common_ptr)cinfo); /* use common routine */  | 
118  | 37.4k  | }  | 
119  |  |  | 
120  |  |  | 
121  |  | /*  | 
122  |  |  * Set default decompression parameters.  | 
123  |  |  */  | 
124  |  |  | 
125  |  | LOCAL(void)  | 
126  |  | default_decompress_parms(j_decompress_ptr cinfo)  | 
127  | 46.3k  | { | 
128  |  |   /* Guess the input colorspace, and set output colorspace accordingly. */  | 
129  |  |   /* (Wish JPEG committee had provided a real way to specify this...) */  | 
130  |  |   /* Note application may override our guesses. */  | 
131  | 46.3k  |   switch (cinfo->num_components) { | 
132  | 1.88k  |   case 1:  | 
133  | 1.88k  |     cinfo->jpeg_color_space = JCS_GRAYSCALE;  | 
134  | 1.88k  |     cinfo->out_color_space = JCS_GRAYSCALE;  | 
135  | 1.88k  |     break;  | 
136  |  |  | 
137  | 42.4k  |   case 3:  | 
138  | 42.4k  |     if (cinfo->saw_JFIF_marker) { | 
139  | 28.6k  |       cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */  | 
140  | 28.6k  |     } else if (cinfo->saw_Adobe_marker) { | 
141  | 1.76k  |       switch (cinfo->Adobe_transform) { | 
142  | 1.65k  |       case 0:  | 
143  | 1.65k  |         cinfo->jpeg_color_space = JCS_RGB;  | 
144  | 1.65k  |         break;  | 
145  | 24  |       case 1:  | 
146  | 24  |         cinfo->jpeg_color_space = JCS_YCbCr;  | 
147  | 24  |         break;  | 
148  | 79  |       default:  | 
149  | 79  |         WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);  | 
150  | 79  |         cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */  | 
151  | 79  |         break;  | 
152  | 1.76k  |       }  | 
153  | 12.0k  |     } else { | 
154  |  |       /* Saw no special markers, try to guess from the component IDs */  | 
155  | 12.0k  |       int cid0 = cinfo->comp_info[0].component_id;  | 
156  | 12.0k  |       int cid1 = cinfo->comp_info[1].component_id;  | 
157  | 12.0k  |       int cid2 = cinfo->comp_info[2].component_id;  | 
158  |  |  | 
159  | 12.0k  |       if (cid0 == 1 && cid1 == 2 && cid2 == 3)  | 
160  | 9.99k  |         cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */  | 
161  | 2.05k  |       else if (cid0 == 82 && cid1 == 71 && cid2 == 66)  | 
162  | 0  |         cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */  | 
163  | 2.05k  |       else { | 
164  | 2.05k  |         TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);  | 
165  | 2.05k  |         cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */  | 
166  | 2.05k  |       }  | 
167  | 12.0k  |     }  | 
168  |  |     /* Always guess RGB is proper output colorspace. */  | 
169  | 42.4k  |     cinfo->out_color_space = JCS_RGB;  | 
170  | 42.4k  |     break;  | 
171  |  |  | 
172  | 1.71k  |   case 4:  | 
173  | 1.71k  |     if (cinfo->saw_Adobe_marker) { | 
174  | 811  |       switch (cinfo->Adobe_transform) { | 
175  | 178  |       case 0:  | 
176  | 178  |         cinfo->jpeg_color_space = JCS_CMYK;  | 
177  | 178  |         break;  | 
178  | 73  |       case 2:  | 
179  | 73  |         cinfo->jpeg_color_space = JCS_YCCK;  | 
180  | 73  |         break;  | 
181  | 560  |       default:  | 
182  | 560  |         WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);  | 
183  | 560  |         cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */  | 
184  | 560  |         break;  | 
185  | 811  |       }  | 
186  | 904  |     } else { | 
187  |  |       /* No special markers, assume straight CMYK. */  | 
188  | 904  |       cinfo->jpeg_color_space = JCS_CMYK;  | 
189  | 904  |     }  | 
190  | 1.71k  |     cinfo->out_color_space = JCS_CMYK;  | 
191  | 1.71k  |     break;  | 
192  |  |  | 
193  | 299  |   default:  | 
194  | 299  |     cinfo->jpeg_color_space = JCS_UNKNOWN;  | 
195  | 299  |     cinfo->out_color_space = JCS_UNKNOWN;  | 
196  | 299  |     break;  | 
197  | 46.3k  |   }  | 
198  |  |  | 
199  |  |   /* Set defaults for other decompression parameters. */  | 
200  | 46.3k  |   cinfo->scale_num = 1;         /* 1:1 scaling */  | 
201  | 46.3k  |   cinfo->scale_denom = 1;  | 
202  | 46.3k  |   cinfo->output_gamma = 1.0;  | 
203  | 46.3k  |   cinfo->buffered_image = FALSE;  | 
204  | 46.3k  |   cinfo->raw_data_out = FALSE;  | 
205  | 46.3k  |   cinfo->dct_method = JDCT_DEFAULT;  | 
206  | 46.3k  |   cinfo->do_fancy_upsampling = TRUE;  | 
207  | 46.3k  |   cinfo->do_block_smoothing = TRUE;  | 
208  | 46.3k  |   cinfo->quantize_colors = FALSE;  | 
209  |  |   /* We set these in case application only sets quantize_colors. */  | 
210  | 46.3k  |   cinfo->dither_mode = JDITHER_FS;  | 
211  | 46.3k  | #ifdef QUANT_2PASS_SUPPORTED  | 
212  | 46.3k  |   cinfo->two_pass_quantize = TRUE;  | 
213  |  | #else  | 
214  |  |   cinfo->two_pass_quantize = FALSE;  | 
215  |  | #endif  | 
216  | 46.3k  |   cinfo->desired_number_of_colors = 256;  | 
217  | 46.3k  |   cinfo->colormap = NULL;  | 
218  |  |   /* Initialize for no mode change in buffered-image mode. */  | 
219  | 46.3k  |   cinfo->enable_1pass_quant = FALSE;  | 
220  | 46.3k  |   cinfo->enable_external_quant = FALSE;  | 
221  | 46.3k  |   cinfo->enable_2pass_quant = FALSE;  | 
222  | 46.3k  | }  | 
223  |  |  | 
224  |  |  | 
225  |  | /*  | 
226  |  |  * Decompression startup: read start of JPEG datastream to see what's there.  | 
227  |  |  * Need only initialize JPEG object and supply a data source before calling.  | 
228  |  |  *  | 
229  |  |  * This routine will read as far as the first SOS marker (ie, actual start of  | 
230  |  |  * compressed data), and will save all tables and parameters in the JPEG  | 
231  |  |  * object.  It will also initialize the decompression parameters to default  | 
232  |  |  * values, and finally return JPEG_HEADER_OK.  On return, the application may  | 
233  |  |  * adjust the decompression parameters and then call jpeg_start_decompress.  | 
234  |  |  * (Or, if the application only wanted to determine the image parameters,  | 
235  |  |  * the data need not be decompressed.  In that case, call jpeg_abort or  | 
236  |  |  * jpeg_destroy to release any temporary space.)  | 
237  |  |  * If an abbreviated (tables only) datastream is presented, the routine will  | 
238  |  |  * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then  | 
239  |  |  * re-use the JPEG object to read the abbreviated image datastream(s).  | 
240  |  |  * It is unnecessary (but OK) to call jpeg_abort in this case.  | 
241  |  |  * The JPEG_SUSPENDED return code only occurs if the data source module  | 
242  |  |  * requests suspension of the decompressor.  In this case the application  | 
243  |  |  * should load more source data and then re-call jpeg_read_header to resume  | 
244  |  |  * processing.  | 
245  |  |  * If a non-suspending data source is used and require_image is TRUE, then the  | 
246  |  |  * return code need not be inspected since only JPEG_HEADER_OK is possible.  | 
247  |  |  *  | 
248  |  |  * This routine is now just a front end to jpeg_consume_input, with some  | 
249  |  |  * extra error checking.  | 
250  |  |  */  | 
251  |  |  | 
252  |  | GLOBAL(int)  | 
253  |  | jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)  | 
254  | 48.8k  | { | 
255  | 48.8k  |   int retcode;  | 
256  |  |  | 
257  | 48.8k  |   if (cinfo->global_state != DSTATE_START &&  | 
258  | 48.8k  |       cinfo->global_state != DSTATE_INHEADER)  | 
259  | 0  |     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  | 
260  |  |  | 
261  | 48.8k  |   retcode = jpeg_consume_input(cinfo);  | 
262  |  |  | 
263  | 48.8k  |   switch (retcode) { | 
264  | 46.3k  |   case JPEG_REACHED_SOS:  | 
265  | 46.3k  |     retcode = JPEG_HEADER_OK;  | 
266  | 46.3k  |     break;  | 
267  | 959  |   case JPEG_REACHED_EOI:  | 
268  | 959  |     if (require_image)          /* Complain if application wanted an image */  | 
269  | 0  |       ERREXIT(cinfo, JERR_NO_IMAGE);  | 
270  |  |     /* Reset to start state; it would be safer to require the application to  | 
271  |  |      * call jpeg_abort, but we can't change it now for compatibility reasons.  | 
272  |  |      * A side effect is to free any temporary memory (there shouldn't be any).  | 
273  |  |      */  | 
274  | 959  |     jpeg_abort((j_common_ptr)cinfo); /* sets state = DSTATE_START */  | 
275  | 959  |     retcode = JPEG_HEADER_TABLES_ONLY;  | 
276  | 959  |     break;  | 
277  | 0  |   case JPEG_SUSPENDED:  | 
278  |  |     /* no work */  | 
279  | 0  |     break;  | 
280  | 48.8k  |   }  | 
281  |  |  | 
282  | 47.3k  |   return retcode;  | 
283  | 48.8k  | }  | 
284  |  |  | 
285  |  |  | 
286  |  | /*  | 
287  |  |  * Consume data in advance of what the decompressor requires.  | 
288  |  |  * This can be called at any time once the decompressor object has  | 
289  |  |  * been created and a data source has been set up.  | 
290  |  |  *  | 
291  |  |  * This routine is essentially a state machine that handles a couple  | 
292  |  |  * of critical state-transition actions, namely initial setup and  | 
293  |  |  * transition from header scanning to ready-for-start_decompress.  | 
294  |  |  * All the actual input is done via the input controller's consume_input  | 
295  |  |  * method.  | 
296  |  |  */  | 
297  |  |  | 
298  |  | GLOBAL(int)  | 
299  |  | jpeg_consume_input(j_decompress_ptr cinfo)  | 
300  | 48.8k  | { | 
301  | 48.8k  |   int retcode = JPEG_SUSPENDED;  | 
302  |  |  | 
303  |  |   /* NB: every possible DSTATE value should be listed in this switch */  | 
304  | 48.8k  |   switch (cinfo->global_state) { | 
305  | 48.8k  |   case DSTATE_START:  | 
306  |  |     /* Start-of-datastream actions: reset appropriate modules */  | 
307  | 48.8k  |     (*cinfo->inputctl->reset_input_controller) (cinfo);  | 
308  |  |     /* Initialize application's data source module */  | 
309  | 48.8k  |     (*cinfo->src->init_source) (cinfo);  | 
310  | 48.8k  |     cinfo->global_state = DSTATE_INHEADER;  | 
311  |  |     FALLTHROUGH                 /*FALLTHROUGH*/  | 
312  | 48.8k  |   case DSTATE_INHEADER:  | 
313  | 48.8k  |     retcode = (*cinfo->inputctl->consume_input) (cinfo);  | 
314  | 48.8k  |     if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ | 
315  |  |       /* Set up default parameters based on header data */  | 
316  | 46.3k  |       default_decompress_parms(cinfo);  | 
317  |  |       /* Set global state: ready for start_decompress */  | 
318  | 46.3k  |       cinfo->global_state = DSTATE_READY;  | 
319  | 46.3k  |     }  | 
320  | 48.8k  |     break;  | 
321  | 0  |   case DSTATE_READY:  | 
322  |  |     /* Can't advance past first SOS until start_decompress is called */  | 
323  | 0  |     retcode = JPEG_REACHED_SOS;  | 
324  | 0  |     break;  | 
325  | 0  |   case DSTATE_PRELOAD:  | 
326  | 0  |   case DSTATE_PRESCAN:  | 
327  | 0  |   case DSTATE_SCANNING:  | 
328  | 0  |   case DSTATE_RAW_OK:  | 
329  | 0  |   case DSTATE_BUFIMAGE:  | 
330  | 0  |   case DSTATE_BUFPOST:  | 
331  | 0  |   case DSTATE_STOPPING:  | 
332  | 0  |     retcode = (*cinfo->inputctl->consume_input) (cinfo);  | 
333  | 0  |     break;  | 
334  | 0  |   default:  | 
335  | 0  |     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  | 
336  | 48.8k  |   }  | 
337  | 47.3k  |   return retcode;  | 
338  | 48.8k  | }  | 
339  |  |  | 
340  |  |  | 
341  |  | /*  | 
342  |  |  * Have we finished reading the input file?  | 
343  |  |  */  | 
344  |  |  | 
345  |  | GLOBAL(boolean)  | 
346  |  | jpeg_input_complete(j_decompress_ptr cinfo)  | 
347  | 0  | { | 
348  |  |   /* Check for valid jpeg object */  | 
349  | 0  |   if (cinfo->global_state < DSTATE_START ||  | 
350  | 0  |       cinfo->global_state > DSTATE_STOPPING)  | 
351  | 0  |     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  | 
352  | 0  |   return cinfo->inputctl->eoi_reached;  | 
353  | 0  | }  | 
354  |  |  | 
355  |  |  | 
356  |  | /*  | 
357  |  |  * Is there more than one scan?  | 
358  |  |  */  | 
359  |  |  | 
360  |  | GLOBAL(boolean)  | 
361  |  | jpeg_has_multiple_scans(j_decompress_ptr cinfo)  | 
362  | 0  | { | 
363  |  |   /* Only valid after jpeg_read_header completes */  | 
364  | 0  |   if (cinfo->global_state < DSTATE_READY ||  | 
365  | 0  |       cinfo->global_state > DSTATE_STOPPING)  | 
366  | 0  |     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  | 
367  | 0  |   return cinfo->inputctl->has_multiple_scans;  | 
368  | 0  | }  | 
369  |  |  | 
370  |  |  | 
371  |  | /*  | 
372  |  |  * Finish JPEG decompression.  | 
373  |  |  *  | 
374  |  |  * This will normally just verify the file trailer and release temp storage.  | 
375  |  |  *  | 
376  |  |  * Returns FALSE if suspended.  The return value need be inspected only if  | 
377  |  |  * a suspending data source is used.  | 
378  |  |  */  | 
379  |  |  | 
380  |  | GLOBAL(boolean)  | 
381  |  | jpeg_finish_decompress(j_decompress_ptr cinfo)  | 
382  | 10.2k  | { | 
383  | 10.2k  |   if ((cinfo->global_state == DSTATE_SCANNING ||  | 
384  | 10.2k  |        cinfo->global_state == DSTATE_RAW_OK) && !cinfo->buffered_image) { | 
385  |  |     /* Terminate final pass of non-buffered mode */  | 
386  | 10.2k  |     if (cinfo->output_scanline < cinfo->output_height)  | 
387  | 0  |       ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);  | 
388  | 10.2k  |     (*cinfo->master->finish_output_pass) (cinfo);  | 
389  | 10.2k  |     cinfo->global_state = DSTATE_STOPPING;  | 
390  | 10.2k  |   } else if (cinfo->global_state == DSTATE_BUFIMAGE) { | 
391  |  |     /* Finishing after a buffered-image operation */  | 
392  | 0  |     cinfo->global_state = DSTATE_STOPPING;  | 
393  | 0  |   } else if (cinfo->global_state != DSTATE_STOPPING) { | 
394  |  |     /* STOPPING = repeat call after a suspension, anything else is error */  | 
395  | 0  |     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);  | 
396  | 0  |   }  | 
397  |  |   /* Read until EOI */  | 
398  | 13.0k  |   while (!cinfo->inputctl->eoi_reached) { | 
399  | 2.73k  |     if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)  | 
400  | 0  |       return FALSE;             /* Suspend, come back later */  | 
401  | 2.73k  |   }  | 
402  |  |   /* Do final cleanup */  | 
403  | 10.2k  |   (*cinfo->src->term_source) (cinfo);  | 
404  |  |   /* We can use jpeg_abort to release memory and reset global_state */  | 
405  | 10.2k  |   jpeg_abort((j_common_ptr)cinfo);  | 
406  | 10.2k  |   return TRUE;  | 
407  | 10.2k  | }  |