Skip to content

Commit 7970d71

Browse files
committed
Minor code clean-up & reformatting.
1 parent 3b57b33 commit 7970d71

File tree

4 files changed

+66
-58
lines changed

4 files changed

+66
-58
lines changed

src/common/mipmap_cache.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,10 @@ static void _init_8(uint8_t *buf,
14711471
const int imgwd = img2->width;
14721472
const int imght = img2->height;
14731473
dt_image_cache_read_release(darktable.image_cache, img2);
1474-
if(thumb_width < wd && thumb_height < ht && thumb_width < imgwd - 4 && thumb_height < imght - 4)
1474+
if(thumb_width < wd
1475+
&& thumb_height < ht
1476+
&& thumb_width < imgwd - 4
1477+
&& thumb_height < imght - 4)
14751478
{
14761479
res = TRUE;
14771480
}
@@ -1481,7 +1484,8 @@ static void _init_8(uint8_t *buf,
14811484
dt_print(DT_DEBUG_CACHE,
14821485
"[mipmap_cache] generate mip %d for ID=%d from embedded jpeg\n",
14831486
size, imgid);
1484-
dt_iop_flip_and_zoom_8(tmp, thumb_width, thumb_height, buf, wd, ht, orientation, width, height);
1487+
dt_iop_flip_and_zoom_8(tmp, thumb_width, thumb_height,
1488+
buf, wd, ht, orientation, width, height);
14851489
}
14861490
dt_free_align(tmp);
14871491
}
@@ -1521,8 +1525,9 @@ static void _init_8(uint8_t *buf,
15211525
dat.head.max_width = wd;
15221526
dat.head.max_height = ht;
15231527
dat.buf = buf;
1524-
// export with flags: ignore exif(don't load from disk), don't swap byte order, don't do hq processing,
1525-
// no upscaling and signal we want thumbnail export
1528+
// export with flags: ignore exif(don't load from disk), don't
1529+
// swap byte order, don't do hq processing, no upscaling and
1530+
// signal we want thumbnail export
15261531
res = dt_imageio_export_with_flags(imgid, "unused", &format, (dt_imageio_module_data_t *)&dat, TRUE, FALSE, FALSE,
15271532
FALSE, FALSE, TRUE, NULL, FALSE, FALSE, DT_COLORSPACE_NONE, NULL, DT_INTENT_LAST, NULL,
15281533
NULL, 1, 1, NULL, -1);

src/imageio/imageio.c

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ dt_image_flags_t dt_imageio_get_type_from_extension(const char *extension)
148148

149149
// load a full-res thumbnail:
150150
gboolean dt_imageio_large_thumbnail(const char *filename,
151-
uint8_t **buffer,
152-
int32_t *width,
153-
int32_t *height,
154-
dt_colorspaces_color_profile_type_t *color_space)
151+
uint8_t **buffer,
152+
int32_t *width,
153+
int32_t *height,
154+
dt_colorspaces_color_profile_type_t *color_space)
155155
{
156156
int res = TRUE;
157157

@@ -688,21 +688,21 @@ void dt_imageio_to_fractional(const float in,
688688
}
689689

690690
gboolean dt_imageio_export(const dt_imgid_t imgid,
691-
const char *filename,
692-
dt_imageio_module_format_t *format,
693-
dt_imageio_module_data_t *format_params,
694-
const gboolean high_quality,
695-
const gboolean upscale,
696-
const gboolean copy_metadata,
697-
const gboolean export_masks,
698-
const dt_colorspaces_color_profile_type_t icc_type,
699-
const gchar *icc_filename,
700-
const dt_iop_color_intent_t icc_intent,
701-
dt_imageio_module_storage_t *storage,
702-
dt_imageio_module_data_t *storage_params,
703-
const int num,
704-
const int total,
705-
dt_export_metadata_t *metadata)
691+
const char *filename,
692+
dt_imageio_module_format_t *format,
693+
dt_imageio_module_data_t *format_params,
694+
const gboolean high_quality,
695+
const gboolean upscale,
696+
const gboolean copy_metadata,
697+
const gboolean export_masks,
698+
const dt_colorspaces_color_profile_type_t icc_type,
699+
const gchar *icc_filename,
700+
const dt_iop_color_intent_t icc_intent,
701+
dt_imageio_module_storage_t *storage,
702+
dt_imageio_module_data_t *storage_params,
703+
const int num,
704+
const int total,
705+
dt_export_metadata_t *metadata)
706706
{
707707
if(strcmp(format->mime(format_params), "x-copy") == 0)
708708
/* This is a just a copy, skip process and just export */
@@ -743,27 +743,27 @@ static double _get_pipescale(dt_dev_pixelpipe_t *pipe,
743743
// internal function: to avoid exif blob reading + 8-bit byteorder
744744
// flag + high-quality override
745745
gboolean dt_imageio_export_with_flags(const dt_imgid_t imgid,
746-
const char *filename,
747-
dt_imageio_module_format_t *format,
748-
dt_imageio_module_data_t *format_params,
749-
const gboolean ignore_exif,
750-
const gboolean display_byteorder,
751-
const gboolean high_quality,
752-
const gboolean upscale,
753-
const gboolean is_scaling,
754-
const gboolean thumbnail_export,
755-
const char *filter,
756-
const gboolean copy_metadata,
757-
const gboolean export_masks,
758-
const dt_colorspaces_color_profile_type_t icc_type,
759-
const gchar *icc_filename,
760-
const dt_iop_color_intent_t icc_intent,
761-
dt_imageio_module_storage_t *storage,
762-
dt_imageio_module_data_t *storage_params,
763-
int num,
764-
const int total,
765-
dt_export_metadata_t *metadata,
766-
const int history_end)
746+
const char *filename,
747+
dt_imageio_module_format_t *format,
748+
dt_imageio_module_data_t *format_params,
749+
const gboolean ignore_exif,
750+
const gboolean display_byteorder,
751+
const gboolean high_quality,
752+
const gboolean upscale,
753+
const gboolean is_scaling,
754+
const gboolean thumbnail_export,
755+
const char *filter,
756+
const gboolean copy_metadata,
757+
const gboolean export_masks,
758+
const dt_colorspaces_color_profile_type_t icc_type,
759+
const gchar *icc_filename,
760+
const dt_iop_color_intent_t icc_intent,
761+
dt_imageio_module_storage_t *storage,
762+
dt_imageio_module_data_t *storage_params,
763+
int num,
764+
const int total,
765+
dt_export_metadata_t *metadata,
766+
const int history_end)
767767
{
768768
dt_develop_t dev;
769769
dt_dev_init(&dev, FALSE);
@@ -794,8 +794,9 @@ gboolean dt_imageio_export_with_flags(const dt_imgid_t imgid,
794794
filename,img->load_status);
795795
if(img->load_status == DT_IMAGEIO_FILE_NOT_FOUND)
796796
dt_control_log(_("image `%s' is not available!"), img->filename);
797-
else if(img->load_status == DT_IMAGEIO_LOAD_FAILED || img->load_status == DT_IMAGEIO_IOERROR ||
798-
img->load_status == DT_IMAGEIO_CACHE_FULL)
797+
else if(img->load_status == DT_IMAGEIO_LOAD_FAILED
798+
|| img->load_status == DT_IMAGEIO_IOERROR
799+
|| img->load_status == DT_IMAGEIO_CACHE_FULL)
799800
dt_control_log(_("unable to load image `%s'!"), img->filename);
800801
else
801802
dt_control_log(_("image '%s' not supported"), img->filename);
@@ -913,13 +914,13 @@ gboolean dt_imageio_export_with_flags(const dt_imgid_t imgid,
913914
}
914915

915916
dt_print(DT_DEBUG_ALWAYS,
916-
"[dt_imageio_export_with_flags] %s%s%s%s%s modules:%s\n",
917-
use_style && appending ? "append style history " : "",
918-
use_style && !appending ? "replace style history " : "",
919-
use_style ? "`" : "",
920-
use_style && format_params ? format_params->style : "",
921-
use_style ? "'." : "",
922-
mbuf);
917+
"[dt_imageio_export_with_flags] %s%s%s%s%s modules:%s\n",
918+
use_style && appending ? "append style history " : "",
919+
use_style && !appending ? "replace style history " : "",
920+
use_style ? "`" : "",
921+
use_style && format_params ? format_params->style : "",
922+
use_style ? "'." : "",
923+
mbuf);
923924
}
924925

925926
if(filter)

src/imageio/storage/disk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ int store(dt_imageio_module_storage_t *self,
469469

470470
/* export image to file */
471471
if(!dt_imageio_export(imgid, filename, format, fdata, high_quality,
472-
upscale, TRUE, export_masks, icc_type,
473-
icc_filename, icc_intent, self, sdata,
474-
num, total, metadata))
472+
upscale, TRUE, export_masks, icc_type,
473+
icc_filename, icc_intent, self, sdata,
474+
num, total, metadata))
475475
{
476476
dt_print(DT_DEBUG_ALWAYS,
477477
"[imageio_storage_disk] could not export to file: `%s'!\n",

src/imageio/storage/latex.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,13 @@ int store(dt_imageio_module_storage_t *self, dt_imageio_module_data_t *sdata, co
369369
dt_pthread_mutex_unlock(&darktable.plugin_threadsafe);
370370

371371
/* export image to file */
372-
dt_imageio_export(imgid, filename, format, fdata, high_quality, upscale, TRUE, export_masks, icc_type, icc_filename,
372+
dt_imageio_export(imgid, filename, format, fdata, high_quality, upscale,
373+
TRUE, export_masks, icc_type, icc_filename,
373374
icc_intent, self, sdata, num, total, metadata);
374375

375376
dt_print(DT_DEBUG_ALWAYS, "[export_job] exported to `%s'\n", filename);
376-
dt_control_log(ngettext("%d/%d exported to `%s'", "%d/%d exported to `%s'", num),
377+
dt_control_log(ngettext("%d/%d exported to `%s'", "%d/%d exported to `%s'",
378+
num),
377379
num, total, filename);
378380
return 0;
379381
}

0 commit comments

Comments
 (0)