@@ -153,15 +153,15 @@ struct heif_error heif_item_get_property_user_description(const struct heif_cont
153153 }
154154 auto udes = context->context ->find_property <Box_udes>(itemId, propertyId);
155155 if (!udes) {
156- return udes.error . error_struct (context->context .get ());
156+ return udes.error_struct (context->context .get ());
157157 }
158158
159159 auto * udes_c = new heif_property_user_description ();
160160 udes_c->version = 1 ;
161- udes_c->lang = create_c_string_copy (udes. value ->get_lang ());
162- udes_c->name = create_c_string_copy (udes. value ->get_name ());
163- udes_c->description = create_c_string_copy (udes. value ->get_description ());
164- udes_c->tags = create_c_string_copy (udes. value ->get_tags ());
161+ udes_c->lang = create_c_string_copy ((* udes) ->get_lang ());
162+ udes_c->name = create_c_string_copy ((* udes) ->get_name ());
163+ udes_c->description = create_c_string_copy ((* udes) ->get_description ());
164+ udes_c->tags = create_c_string_copy ((* udes) ->get_tags ());
165165
166166 *out = udes_c;
167167
@@ -218,18 +218,7 @@ enum heif_transform_mirror_direction heif_item_get_property_transform_mirror(con
218218 return heif_transform_mirror_direction_invalid;
219219 }
220220
221- return imir.value ->get_mirror_direction ();
222- }
223-
224- enum heif_transform_mirror_direction heif_item_get_property_transform_mirror2 (const struct heif_context * context,
225- heif_item_id itemId)
226- {
227- auto imir = context->context ->find_property <Box_imir>(itemId);
228- if (!imir) {
229- return heif_transform_mirror_direction_invalid;
230- }
231-
232- return imir.value ->get_mirror_direction ();
221+ return (*imir)->get_mirror_direction ();
233222}
234223
235224
@@ -242,19 +231,7 @@ int heif_item_get_property_transform_rotation_ccw(const struct heif_context* con
242231 return -1 ;
243232 }
244233
245- return irot.value ->get_rotation_ccw ();
246- }
247-
248-
249- int heif_item_get_property_transform_rotation_ccw2 (const struct heif_context * context,
250- heif_item_id itemId)
251- {
252- auto irot = context->context ->find_property <Box_irot>(itemId);
253- if (!irot) {
254- return -1 ;
255- }
256-
257- return irot.value ->get_rotation_ccw ();
234+ return (*irot)->get_rotation_ccw ();
258235}
259236
260237void heif_item_get_property_transform_crop_borders (const struct heif_context * context,
@@ -268,29 +245,13 @@ void heif_item_get_property_transform_crop_borders(const struct heif_context* co
268245 return ;
269246 }
270247
271- if (left) *left = clap. value ->left_rounded (image_width);
272- if (right) *right = image_width - 1 - clap. value ->right_rounded (image_width);
273- if (top) *top = clap. value ->top_rounded (image_height);
274- if (bottom) *bottom = image_height - 1 - clap. value ->bottom_rounded (image_height);
248+ if (left) *left = (* clap) ->left_rounded (image_width);
249+ if (right) *right = image_width - 1 - (* clap) ->right_rounded (image_width);
250+ if (top) *top = (* clap) ->top_rounded (image_height);
251+ if (bottom) *bottom = image_height - 1 - (* clap) ->bottom_rounded (image_height);
275252}
276253
277254
278- void heif_item_get_property_transform_crop_borders2 (const struct heif_context * context,
279- heif_item_id itemId,
280- int image_width, int image_height,
281- int * left, int * top, int * right, int * bottom)
282- {
283- auto clap = context->context ->find_property <Box_clap>(itemId);
284- if (!clap) {
285- return ;
286- }
287-
288- if (left) *left = clap.value ->left_rounded (image_width);
289- if (right) *right = image_width - 1 - clap.value ->right_rounded (image_width);
290- if (top) *top = clap.value ->top_rounded (image_height);
291- if (bottom) *bottom = image_height - 1 - clap.value ->bottom_rounded (image_height);
292- }
293-
294255struct heif_error heif_item_add_raw_property (const struct heif_context * context,
295256 heif_item_id itemId,
296257 uint32_t short_type,
@@ -333,15 +294,15 @@ struct heif_error heif_item_get_property_raw_size(const struct heif_context* con
333294 }
334295 auto box_other = context->context ->find_property <Box_other>(itemId, propertyId);
335296 if (!box_other) {
336- return box_other.error . error_struct (context->context .get ());
297+ return box_other.error_struct (context->context .get ());
337298 }
338299
339300 // TODO: every Box (not just Box_other) should have a get_raw_data() method.
340- if (box_other. value == nullptr ) {
301+ if (* box_other == nullptr ) {
341302 return {heif_error_Usage_error, heif_suberror_Invalid_property, " this property is not read as a raw box" };
342303 }
343304
344- const auto & data = box_other. value ->get_raw_data ();
305+ const auto & data = (* box_other) ->get_raw_data ();
345306
346307 *size_out = data.size ();
347308
@@ -360,16 +321,15 @@ struct heif_error heif_item_get_property_raw_data(const struct heif_context* con
360321
361322 auto box_other = context->context ->find_property <Box_other>(itemId, propertyId);
362323 if (!box_other) {
363- return box_other.error . error_struct (context->context .get ());
324+ return box_other.error_struct (context->context .get ());
364325 }
365326
366327 // TODO: every Box (not just Box_other) should have a get_raw_data() method.
367- if (box_other. value == nullptr ) {
328+ if (* box_other == nullptr ) {
368329 return {heif_error_Usage_error, heif_suberror_Invalid_property, " this property is not read as a raw box" };
369330 }
370331
371- auto data = box_other.value ->get_raw_data ();
372-
332+ auto data = (*box_other)->get_raw_data ();
373333
374334 std::copy (data.begin (), data.end (), data_out);
375335
@@ -388,14 +348,14 @@ struct heif_error heif_item_get_property_uuid_type(const struct heif_context* co
388348
389349 auto box_other = context->context ->find_property <Box_other>(itemId, propertyId);
390350 if (!box_other) {
391- return box_other.error . error_struct (context->context .get ());
351+ return box_other.error_struct (context->context .get ());
392352 }
393353
394- if (box_other. value == nullptr ) {
354+ if (* box_other == nullptr ) {
395355 return {heif_error_Usage_error, heif_suberror_Invalid_property, " this property is not read as a raw box" };
396356 }
397357
398- auto uuid = box_other. value ->get_uuid_type ();
358+ auto uuid = (* box_other) ->get_uuid_type ();
399359
400360 std::copy (uuid.begin (), uuid.end (), extended_type);
401361
0 commit comments