static void export_button_clicked (GtkWidget *widget, gpointer user_data) { char style[128]; // Let's get the max dimension restriction if any... // TODO: pass the relevant values directly, not using the conf ... int max_width = dt_conf_get_int ("plugins/lighttable/export/width"); int max_height = dt_conf_get_int ("plugins/lighttable/export/height"); char *format_name = dt_conf_get_string("plugins/lighttable/export/format_name"); char *storage_name = dt_conf_get_string("plugins/lighttable/export/storage_name"); int format_index = dt_imageio_get_index_of_format(dt_imageio_get_format_by_name(format_name)); int storage_index = dt_imageio_get_index_of_storage(dt_imageio_get_storage_by_name(storage_name)); g_free(format_name); g_free(storage_name); gboolean high_quality = dt_conf_get_bool("plugins/lighttable/export/high_quality_processing"); char* tmp = dt_conf_get_string("plugins/lighttable/export/style"); if (tmp) { g_strlcpy(style, tmp, sizeof(style)); g_free(tmp); } int imgid = dt_view_get_image_to_act_on(); GList *list = NULL; if (imgid != -1) list = g_list_append (list, GINT_TO_POINTER(imgid)); else list = dt_collection_get_selected(darktable.collection, -1); dt_control_export(list, max_width, max_height, format_index, storage_index, high_quality,style); }
static gboolean export_key_accel_callback(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, gpointer data) { /* write history before exporting */ dt_dev_write_history((dt_develop_t *)data); /* export current image */ int max_width = dt_conf_get_int ("plugins/lighttable/export/width"); int max_height = dt_conf_get_int ("plugins/lighttable/export/height"); int format_index = dt_conf_get_int ("plugins/lighttable/export/format"); int storage_index = dt_conf_get_int ("plugins/lighttable/export/storage"); gboolean high_quality = dt_conf_get_bool("plugins/lighttable/export/high_quality_processing"); char *style = dt_conf_get_string("plugins/lighttable/export/style"); dt_control_export(max_width, max_height, format_index, storage_index, high_quality, style); return TRUE; }
static void export_button_clicked (GtkWidget *widget, gpointer user_data) { char style[128]; // Let's get the max dimension restriction if any... // TODO: pass the relevant values directly, not using the conf ... int max_width = dt_conf_get_int ("plugins/lighttable/export/width"); int max_height = dt_conf_get_int ("plugins/lighttable/export/height"); int format_index = dt_conf_get_int ("plugins/lighttable/export/format"); int storage_index = dt_conf_get_int ("plugins/lighttable/export/storage"); gboolean high_quality = dt_conf_get_bool("plugins/lighttable/export/high_quality_processing"); char* tmp = dt_conf_get_string("plugins/lighttable/export/style"); if (tmp) { strncpy (style, tmp, 128); g_free(tmp); } dt_control_export(dt_collection_get_selected(darktable.collection),max_width, max_height, format_index, storage_index, high_quality,style); }
static void export_button_clicked (GtkWidget *widget, gpointer user_data) { // Let's get the max dimension restriction if any... dt_control_export(); }